Missing the Rails 2.3.8 gem after bundle install, solved

Ok, basically I have just clone this rails 2.3.8 app which use bundler, and it told me to do “bundle install”, so I did, and it run without any problem, so far so good. After ‘bundle install’ finished successfully I try to run ‘rake db:create’ and it throws this error message :

Missing the Rails 2.3.8 gem. Please `gem install -v=2.3.8 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.

I said, WTF? I do have rails 2.3.8 installed, in fact I’ve been using it for a while without any problem, so why is this new app cannot find it? google to the rescue! I found this post from heroku that explain the problem, and one of the solution is to add the Rails 2.3.8 gem to your gem manifest or Gemfile, so I did. Put this in your Gemfile just after the line that says ‘source :rubygems’

source :rubygems
gem 'rails', '2.3.8'

After that I try to run ‘rake db:create’ again, and it works! that’s another trick in my rails arsenal :)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s