views:

184

answers:

2

I had a exception when I switch to Ruby 1.8.7 on Snow Leopard

ArgumentError: wrong number of arguments (1 for 0)
    /Library/Ruby/Gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/quoting.rb:27:in 'to_s'
    /Library/Ruby/Gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/abstract/quoting.rb:27:in 'quote'
    /Library/Ruby/Gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_adapters/mysql_adapter.rb:190:in 'quote'
    /Library/Ruby/Gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:2042:in 'quote_value'
    /Library/Ruby/Gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb:2034:in 'attributes_with_quotes'

Application uses Rails 1.2.5: there is no chance to update rails in this app. Somebody have solution?

+2  A: 

There will be a lot of compatibility issues with such an old version of rails and ruby 1.8.7. I would suggest using rvm to install multiple ruby versions / rails versions to test your app. I would also look into security patches as I am not sure if they are being backported to the 1.2.x branches.

bobbywilson0
+1 for rvm (http://rvm.beginrescueend.com/ for rvm, http://railscasts.com/episodes/200-rails-3-beta-and-rvm for how to install it)
yuval
A: 

I put this in a file inside config/initializers

class ::DateTime

alias_method :to_s, :to_formatted_s

end

franee