Rails bundler doesn't install gems inside a group
Within a term session, it remembers the without
option. If you first ran
bundle install --without development
it remembers that you did this and will automatically repeat this for the next
bundle install #remembers and includes --without development
running something else, like bundle install --without nothing
should clear the cache. Am I right?
update 20150214: This is fixed in bundler 2.0, according to issue referenced in comment by @Stan Bondi (https://github.com/bundler/bundler/issues/2862). Thanks Stan.
Bundler - updating gems in a particular group
Yes, with
$ bundle update --conservative --group test development
Bundler’s --conservative
option is key, because it prevents updates in any "Production" gem that is also a dependency of a "Test" or "Development" gem.
bundler incorrectly trying to install development and test group gems in production
After a lot of digging I found the fix for this issue. All I had to do was run bundle install --without development test
before starting the server. This adds a .bundle/config
file in the rails root with the line BUNDLE_WITHOUT: test:development
. Now whenever you run bundle install
or start the server it'll ignore those groups.
From the documentation
The Bundler CLI allows you to specify
a list of groups whose gems bundle
install should not install with the
--without option. To specify multiple groups to ignore, specify a list of
groups separated by spaces.bundle install --without test bundle
install --without development test
After running bundle install --without
test, bundler will remember that you
excluded the test group in the last
installation. The next time you run
bundle install, without any --without
option, bundler will recall it.Also, calling Bundler.setup with no
parameters, or calling require
"bundler/setup" will setup all groups
except for the ones you excluded via
--without (since they are obviously not available).
Groups of gems in Bundler
You just need to specify the option. See this too (it saves the option so you only have to specify it once)
bundle install --without production
Related Topics
How to Specify Local .Gem Files in My Gemfile
How to Run Shell Commands on Server in Capistrano V3
Rails Bundler Doesn't Install Gems Inside a Group
How to Dump an Http Request from Within Sinatra
How to Calculate the Offset, in Hours, of a Given Timezone from Utc in Ruby
Using Rails to Consume Web Services/Apis
How to Manage Multiple Gemsets and Ruby Versions with Rvm
What's the Right Way to Implement Equality in Ruby
How to Call Java API from Ruby 1.8 or 1.9
How to Fix a Deadlock Caused by Open
How to Get the Number of Days in a Given Month in Ruby, Accounting for Year
Why 'Self' Method of Module Cannot Become a Singleton Method of Class
How to Take Screenshots of Web Pages Using Ruby and a Unix Server