views:

94

answers:

1

I have a Rails application that uses Bundler for dependency management. I've got the following in my Gemfile:

# default group:
gem 'json'

group 'development' do
  gem 'my_profiler'
end

group 'test' do
  gem 'mocha'
end

group 'deployment' do
  gem 'foo'
end

I call Bundler.setup(:default, RAILS_ENV.to_sym) and Bundler.require(:default, RAILS_ENV.to_sym) in my initializers.

The problem is that since Bundler puts the gems into vendor/bundle/, Rails initializes all gems that have an init.rb, not just those for the current environment. How do I prevent Rails from automatically loading Foo's init.rb?

A: 

What version of bundler are you using? recent ones should not install in vendor

Samer Abukhait
0.9.26. No immediate way to upgrade to 1.0 on this app.
James A. Rosen
I think older versions support --path, so bundle install --path different/location should work
Samer Abukhait