10

This problem was fixed in 0.9.8, but seems to have recurred in the 1.x branch.

In my Gemfile I have a group for the test and development environments that use the rspec gems. On my production server rspec is not installed. I used the command bundle install --without test development in my rails app

Starting my rails app in production mode gives the exception:

Could not find gem 'rspec (>= 0)' in any of the gem sources listed in your Gemfile.

If I comment out the test group the same error happens with the development group.

The same problem exists if I start in development mode, then it tries to load the gems in the test group.

It seems that bundler completely ignores the environment groups and tries to load all gems in Gemfile:

    group :test do
      gem "rspec"
    end

    group :development do
      gem "rspec-rails"
    end


  versions:
  bundle 1.0.15
  rails 3.0.7
  ruby 1.9.2-p180

1 Answer 1

16

I was having this problem too, the problem was that .bundle/config file had something like "--without development test" even tho I had never ran the bundle command with this parameters(maybe I cloned the repository from the Webbynode server and their system added this automatically for production...)

anyway, the fix was

rm .bundle/config
bundle install
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.