Older rails apps fail after gem update


#1

i just upgraded gems to 0.9.2

after restarting the server, all of the previous apps break. checking
the logs reveals this for every actions:

ArgumentError (wrong number of arguments (1 for 0)):
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/
active_record/vendor/mysql.rb:551:in initialize' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/ active_record/vendor/mysql.rb:551:innew’
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/
active_record/vendor/mysql.rb:551:in scramble41' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/ active_record/vendor/mysql.rb:141:inreal_connect’
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/
active_record/connection_adapters/mysql_adapter.rb:331:in connect' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/ active_record/connection_adapters/mysql_adapter.rb:88:ininitialize’
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/
active_record/connection_adapters/mysql_adapter.rb:37:in new' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/ active_record/connection_adapters/mysql_adapter.rb:37:inmysql_connection’
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/
active_record/connection_adapters/abstract/connection_specification.rb:
251:in send' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/ active_record/connection_adapters/abstract/connection_specification.rb: 251:inconnection_without_query_cache=’
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/
active_record/query_cache.rb:54:in connection=' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/ active_record/connection_adapters/abstract/connection_specification.rb: 220:inretrieve_connection’
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/
active_record/connection_adapters/abstract/connection_specification.rb:
78:in connection' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/ active_record/base.rb:1046:inadd_limit!’
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/
active_record/base.rb:1017:in construct_finder_sql' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/ active_record/base.rb:924:infind_every’
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/
active_record/base.rb:918:in find_initial' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/ active_record/base.rb:380:infind’
/app/controllers/pages_controller.rb:4:in index' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/ action_controller/base.rb:910:insend’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/base.rb:910:in perform_action_without_filters' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/ action_controller/filters.rb:368:inperform_action_without_benchmark’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/benchmarking.rb:69:in
perform_action_without_rescue' /usr/local/lib/ruby/1.8/benchmark.rb:293:inmeasure’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/benchmarking.rb:69:in
perform_action_without_rescue' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/ action_controller/rescue.rb:82:inperform_action’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/base.rb:381:in send' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/ action_controller/base.rb:381:inprocess_without_filters’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/
action_controller/filters.rb:377:in
process_without_session_management_support' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/ action_controller/session_management.rb:117:inprocess’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:
38:in `dispatch’
dispatch.cgi:10

any ideas? i’m having a panic attack right now trying to figure out
what’s going on so any help would be greatly appreciated.


#2

Hi –

On 3/15/07, Josh removed_email_address@domain.invalid wrote:

i just upgraded gems to 0.9.2

after restarting the server, all of the previous apps break. checking
the logs reveals this for every actions:

ArgumentError (wrong number of arguments (1 for 0)):
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/
active_record/vendor/mysql.rb:551:in `initialize’

Are you using Ruby 1.8.6? There was a change that broke Rails…
namely, a change in the behavior of Digest::SHA1.new. I got this
error on line 566, I think, but I suspect it’s related.

If you upgrade your Rails gems to 1.2.3 it should be OK (if my
diagnosis is right).

David


Q. What is THE Ruby book for Rails developers?
A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black)
(See what readers are saying! http://www.rubypal.com/r4rrevs.pdf)
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?
A. Ruby Power and Light, LLC (http://www.rubypal.com)


#3

On 3/15/07, David A. Black removed_email_address@domain.invalid wrote:

/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/

active_record/vendor/mysql.rb:551:in `initialize’

Are you using Ruby 1.8.6? There was a change that broke Rails…
namely, a change in the behavior of Digest::SHA1.new. I got this
error on line 566, I think, but I suspect it’s related.

In fact I’m virtually sure of it – the line # difference can be
explained by different AR versions.

David


Q. What is THE Ruby book for Rails developers?
A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black)
(See what readers are saying! http://www.rubypal.com/r4rrevs.pdf)
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?
A. Ruby Power and Light, LLC (http://www.rubypal.com)


#4

Thanks for the reply david.

Unfortunately i am still having problems. my host did update ruby to
1.8.6 last night, right now, i just want to get my older apps back up.
should i ask him to rollback the ruby version?


#5

Hi –

On 3/15/07, Josh removed_email_address@domain.invalid wrote:

Thanks for the reply david.

Unfortunately i am still having problems. my host did update ruby to
1.8.6 last night, right now, i just want to get my older apps back up.
should i ask him to rollback the ruby version?

Yes, or freeze your applications to Rails edge or 1.2.3. 1.8.6
definitely broke Rails as it stood at the 1.2.2 release.

David


Q. What is THE Ruby book for Rails developers?
A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black)
(See what readers are saying! http://www.rubypal.com/r4rrevs.pdf)
Q. Where can I get Ruby/Rails on-site training, consulting, coaching?
A. Ruby Power and Light, LLC (http://www.rubypal.com)


#6

I had the same problem, that’s what I did:
1: I deleted the directory of the relevant rails app on my hosts server
(of course backup any important stuff you don’t have offline)
2: via ssh I created a new fresh version on the host-server (you of
course need ssh access, but just ask your host)
3: I uploaded all relevant files/directories over the fresh rails app.
That was the whole “app” directory some stuff in the “public” directory,
namely stylesheets and images (and deleting index.html) database.yml,
the “db” directory, routes.db (if you use them) and set the environment
to production by uncommenting the line in environment.rb .
You probably have to upload other stuff depending on what you used and
changed.
I’m sure there is an easier way to achieve this, by only keeping the
files that’s needed but I couldn’t pinpoint all those files yet.
Hope that helps


#7

did something change with the routing in the new version of rails?

after freezing rails to the app, nothing works that isn’t on the first
page.