rails gem not installing when running 'bundle install'

I'm sure this is a really easy question to answer but it's confounding me.

Running on Windows, in my Gemfile I have

gem 'rails', '3.0.3'

So when I sync my source out to my production environment, I'd expect to be able to run a 'bundle install' and all the appropriate gems would get installed, including the rails gem, but this isn't the case. All the other supporting gems are installed except the rails gem. I actually have to seperately run 'gem install rails' to get it.

I'm sure I'm doing/missing something really silly, so please enlighten me. Many thanks.

What happens when you run bundle install on your production machine? What do you see when you run:

bundle show rails

bundle show rails C:/system/Ruby/lib/ruby/gems/1.9.1/gems/rails-3.0.3

which is what I'd expect because its what I have specifically installed, however. When I just ran bundle install, if I'd run this command I wouldn't have expected to see similar output as the gem wasn't there at all.

To anyone who finds this.

Bundler does install the rails gem, however. What bundler doesn't do is setup the Windows shortcuts in the ruby\bin directory to allow the rails command to work. If you 'gem install rails', those shortcuts are setup and then you can run the rails command.

To anyone who finds this.

Bundler does install the rails gem, however. What bundler doesn't do is setup the Windows shortcuts in the ruby\bin directory to allow the rails command to work. If you 'gem install rails', those shortcuts are setup and then you can run the rails command.

if rails is in your bundle then

bundle exec rails

should run it for you even if there is no shortcut in place

Fred

Thanks for that, very useful :slight_smile: