views:

56

answers:

3

Why does this happen?

ruby script/console
Loading development environment (Rails 2.0.2)
>> exit
jay-z-mac-pro:justinz$ rails -v
Rails 2.3.3
A: 

Maybe your project is pinned to version 2.0.2. I haven't worked with Rails for quite some time, so I can't say for sure, but I believe this can be done in a config file.

Also, you should check if Rails is in your vendor directory (was that what it is called?). That's another way to force a specific version.

mooware
A: 

Check your config/environment.rb, it sets the Rails version for your application. It should be something like this:

RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION

script/console will load your application with the gems (including Rails) that you define in the config. rails is just the latest rails gem installed.

However, moving from Rails 2.0.2 to 2.3.3 is a pretty big change, you'll want to be careful about upgrading. Make sure to read the docs as it relates to your application.

Dan McNevin
+2  A: 

Look at your RAILS_ROOT/config/environment.rb file. In it you can set and lock the Rails gem version to load. Look for the line:

RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION

Change that to

RAILS_GEM_VERSION = '2.3.3' unless defined? RAILS_GEM_VERSION
ScottD