Rails app failing because I upgraded Rails

Hi,

Some time ago I ran "ruby script/server" and WeBrick server booted. Today, I ran the same command in the same directory (unchanged, I believe) and got:

What does gem -v report?

Jeff

purpleworkshops.com softiesonrails.com

Hi, does your environment.rb reflect the version that's installed?

-Conrad

Also, you might want to run the following command after you update
environment.rb:

rake rails:update

When you upgrade rails, a lot of things can become deprecated: ie. I think that the function "require_gem" is now just "require"

You can see where this is being called into by going to line 28 of your config/boot.rb file.

if you want to update this to run on the new version of rails, you can run from your root: "rake rails:update:configs"

Something else to look into when you upgrade your rails, is freezing the apps that you have successfully running on older versions:

do you know which version you upgraded from?

JP

Hello All,

Many thanks for all your suggestions. I’m going to respond to all of them here. But first an embarrassing admission: When I did the same thing (I think) as I did earlier today, I got the expected result:

K:\_Projects\Ruby\_Rails_Apps\Rails_2.0_Demo>ruby script/server => Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... ** Rails loaded. ** Loading any Rails specific GemPlugins ** Signals ready. INT => stop (no restart). ** Mongrel 1.1.4 available at 0.0.0.0:3000 ** Use CTRL-C to stop.

Sorry about the false alarm. However, I will gain from your suggestions.

Jeff: What does gem -v report?

1.0.1

Conrad: Does your environment.rb reflect the version that's installed?

RAILS_GEM_VERSION environment var is undefined environment.rb sets RAILS_GEM_VERSION = '2.0.2' rails –v => Rails 2.0.2

Conrad: Run the “rake rails:update“ after you update environment.rb:

Will do in the future. Thanks

Jason: I think that the function "require_gem" is now just "require" [snip] line 28 of your config/boot.rb file.

There’s no "require_gem" in config/boot.rb

To update to the new version of rails, run from your root: "rake rails:update:configs"

Nice to know, Thanks

Freezing apps that run on older versions: Freezing Rails | Tiger Technologies Support

Nice to know, Thanks

Again, thanks to all of you. You’re a great bunch!

Best wishes, Richard

Jason: I think that the function "require_gem" is now just "require" [snip] line 28 of your config/boot.rb file.

Hey Richard,

no it may not be there, but you have this error in your log from above:

./script/../config/boot.rb:28: undefined method `require_gem' for main:Object (NoMethodError)

so boot.rb is calling a function in a file somewhere else, which may in-turn be calling another file somewhere with "require_gem" inside of it. Sometimes tracking this down is a pain, however that's what the stack trace is good for. It can often help you discover where the problem is, in this case I would've guessed it was with a version of rails or a version of gems - the older of which would have been calling "require_gem", the newer of which would have been calling "require".

Hi Jason,

Thanks for following up on this. I never noticed that I should at line 28 of the boot.rb file when the problem occurred. The problem now (or the good news is) when I tried to run the app today, it ran fine. So there's no debugging to be done because I don't know how I caused the crash.

I've just started a new app along the lines of the one that I got running on my second try. And as you might expect, I encountered a migration problem. I going to post that on a new thread, and I hope you'lll take a look at it. This time I'm saving all the relevant windows until I get a resolution to this new one.

Again, thanks for posting again on my problem.

Best wishes, Richard