ruby-on-rails

Ruby threads cannot be used in RubyCocoa without patches to the Ruby interpreter

I found this error in Ruby console while I am testing a Rails application. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib /mongrel.rb:285: in `run': Ruby threads cannot be used in RubyCocoa without patches to the Ruby interpreter So I guess I have to patch or re-install RubyCocoa....

can't start script/console with Ruby 1.9 and Rails 2.3.4

Hi, I'm trying to start the console (irb) in Ruby 1.9 with Rails 2.3.4. I have two versions installed of Ruby (1.9 & 1.8.6) and I run the Ruby 1.9 by calling: rake19, ruby19, gem19...etc And they work fine in all situations except this! it seems that its trying to load Ruby 1.8 instead! Do you know how I can change that? Macintosh-10:...

Escape_javascript problem

I have a set of dependent dropdown menus on my user/edit page. The user selects the parent dropdown, which then limits the selections available in the child dropdown. The user can add multiple additional sets of parent/child dropdowns. Product is the parent. Variety is the child. This all works great unless a variety is entered into...

Restful Authentication Action Controller: Exception caught problem

When login fails, it redirects to session path and i get that Exception caught error and it says Unknown action No action responded to show. Actions: accessdenied, checkroles, create, destroy, new, renderoptionalerrorfile, rolerequirements, and role_requirements= sessions_controller def new end def create ...

Delayed Job works in development but not in production

My application uses the Collective Idea fork of Delayed Job to send email asynchronously. The problem is that this works fine in the development environment but not in production. The jobs aren't failing (I've checked the delayed_jobs table), they're just not being consumed. There is nothing of note in the production log. This is the co...

RubyOnRails start server runtime error

Hello, I'm trying to run RoR server under ubuntu 9.10: > ruby script/server > => Booting WEBrick > => Rails 2.3.4 application starting on http://0.0.0.0:3000 > /var/lib/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:271:in > `require_frameworks': no such file to > load -- net/https (RuntimeError) > from /var/lib/ge...

ruby on rails: Store data for current_user on different models

I am trying to store data from the current_user in a User model with attr_accessor :offset. I would like to fetch records of a different model using the offset stored in the current_user model. When I change this offset from a different model it does not save it? I feel a database Column for the offest is overkill. This offset would be ...

Can this relationship be described in Ruby on Rails?

Is this a relationship that can be described in Ruby on Rails' ActiveRecord model relationships? Customer Address =================== ========= Billing_Address_Id >------} }---|- AddressId Shipping_Address_Id >------} So that I could have data that looks...

How can I migrate my data from my rails app from mySql to SQLite

How can I migrate my data from my rails app from mySql to SQLite? Is this possible? ...

Help refactoring this nasty Ruby if/else statement

So I have this big, hairy if/else statement. I pass a tracking number to it, and then it determines what type of tracking number it is. How can I simplify this thing? Specifically wanting to reduce the number of lines of codes. if num_length < 8 tracking_service = false else if number[1, 1] == 'Z' tracking_service = 'ups' els...

Receiving REST response on local machine

I use a web service to convert files. The service returns the converted file as an HTTP POST, along with identifier data. My app receives the response, updates its database and saves the file to the appropriate location. At least that's the idea, but how do I develop and test this on a local machine? Since it isn't publicly facing, I ca...

mod_ruby on apache: Very slow

Even a request from the server itself takes about 7 seconds ( startpage of a "redmine" installation ).. When running ruby under WEBrick the same request only takes miliseconds... I am absolutely new to ruby, so i have no idea where to start the investgation on this.. Or is the best solution to locally redirect the apache request to a W...

Is there a Ruby on Rails site thumbnail generator available?

I'm hoping to avoid building this if it already exists. Does anyone know of a plugin for Ruby on Rails that will generate a screenshot of a web site? Thanks in advance to anyone who can help me find one. ...

Can't get webrat to work with a Rails 2.0.2 app

I have a simple test just to see if I can get webrat working that is failing. class AuthenticationTest < ActionController::IntegrationTest def test_logging_in_with_valid_username_and_password get login_url end end With the above all I get in the error message is: 1) Error: test_logging_in_with_valid_username_and_password(Authe...

Automate deployment of files to Amazon S3?

I have a Rails project that I will be deploying to the spectacularly awesome Heroku. I would really like to be able to automate pushing my resources to Amazon S3 automatically, resources in this case being my images, stylesheets and javascript. Obviously I can write some sort of capistrano task to do this myself, but does anyone know ...

rails html helper

I'm trying to figure out the cleanest way to generate a bit of html AND nest content inside it. Using HAML. Basically I want to do something like: = block_large This is some nested content And that should generate: <div class="block large"> <img src="block_large_carat.gif" class="block_large_carat"> This is some nested content...

User collaboration in rails

Hi, I'm building a simple project collaboration tool using rails 2.3. Authentication is handling with Restful Authentication plugin and for role management using Role Requirement plugin. I need to create User collaboration. For example, when an authorized User logged in, User can create a team that belongs to User, so team can login a...

Can't install Ruby on OS X

I'm trying to follow the installation instructions for Ruby on Rails from Hivelogic.com. I've done this before on previous installs of OSX without trouble. I'm having trouble this time installing on Snow Leopard. At the end of the "make" step installing Ruby, I get a number of errors related to readline. Not sure if this matters, but h...

iPhone NSTimeZone: localTimeZone confusion

From what I understand, calling NSLog(@"Local Time Zone %@",[[NSTimeZone localTimeZone] name]); gives you the local time zone of the device. What it's giving me is "US/Central", and I can't find that anywhere in the list of abbreviations in [NSTimeZone abbreviationDictionary], or the list of time zone names in [NSTimeZone knownT...

How to resolve Rails model namespace collision

The story so far: I have a rails app with a model named "Term". All is well until trying to install Cucumber. Upon running rake cucumber I get Term is not a class (TypeError) This happens because Cucumber includes another gem, 'term-ansicolor' (to do the nifty colored text output in the console), and term-ansicolor defines a modul...