Forum: Ruby on Rails older rails apps fail after gem update

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
66d1d0df01e4bbb82674a353ea68d6ee?d=identicon&s=25 Josh Kieschnick (jjkiesch)
on 2007-03-15 17:21
(Received via mailing list)
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:in `new'
    /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:in `real_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:in `initialize'
    /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:in
`mysql_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:in `connection_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:in `retrieve_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:in `add_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:in `find_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:in `find'
    /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:in `send'
    /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:in `perform_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:in `measure'
    /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:in `perform_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:in `process_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:in `process'
    /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.
1fba4539b6cafe2e60a2916fa184fc2f?d=identicon&s=25 David A. Black (Guest)
on 2007-03-15 17:50
(Received via mailing list)
Hi --

On 3/15/07, Josh <jjkiesch@gmail.com> 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)
1fba4539b6cafe2e60a2916fa184fc2f?d=identicon&s=25 David A. Black (Guest)
on 2007-03-15 17:52
(Received via mailing list)
On 3/15/07, David A. Black <dblack@wobblini.net> 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)
66d1d0df01e4bbb82674a353ea68d6ee?d=identicon&s=25 Josh Kieschnick (jjkiesch)
on 2007-03-15 17:56
(Received via mailing list)
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?
1fba4539b6cafe2e60a2916fa184fc2f?d=identicon&s=25 David A. Black (Guest)
on 2007-03-15 18:17
(Received via mailing list)
Hi --

On 3/15/07, Josh <jjkiesch@gmail.com> 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)
66d1d0df01e4bbb82674a353ea68d6ee?d=identicon&s=25 Josh Kieschnick (jjkiesch)
on 2007-03-15 18:45
(Received via mailing list)
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.
E38607fd2dd775cb8741883534292895?d=identicon&s=25 Oem (Guest)
on 2007-03-18 16:47
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
This topic is locked and can not be replied to.