views:

24

answers:

3

I downloaded an archive containing code for a Rails application ( from a book I'm reading ). I'm running Rails 3.0.1 but the application fails to start, because it's looking for 3.0.0beta3. Is there some way of starting it with my version of Rails?

A: 

There is probably a line in the environment.rb file that looks like

RAILS_GEM_VERSION = '3.0.0beta3' unless defined? RAILS_GEM_VERSION

Updating this should sort your issue.

SamStephens
No, Rails 3 applications use a Gemfile to store the Rails version. The `environment.rb` does not contain a version anymore.
molf
Ah, okay... I did a bit of a search and saw RAILS_GEM_VERSION mentioned in connection to version 3, and assumed it must still use the same scheme. My mistake.
SamStephens
+5  A: 

Yes, look for the Gem file in the application root and look for the line

gem 'rails', '3.0.0beta3' and change it to gem 'rails', '3.0.1'

then run bundle install from a terminal in your application root.

Volker Pacher
+1  A: 

this is because your Gemfile.lock is probably showing Rails 3.0.0.beta3. Even if you change your Gemfile to 3.0.1 AND install it using gem install rails, you will need to run bundle install or bundle update rails

Lukas