Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does 'bundle' install production gems on my development machine?

Gemfile says:

gem 'sqlite3', :groups => [:development, :test]
gem 'mysql2', :group => :production

yet when I type bundle install on my development machine ALL gems are installed.

What's wrong with my setup?

like image 423
Meltemi Avatar asked Aug 06 '11 00:08

Meltemi


People also ask

What is bundle install without production?

Now, If I use following command: bundle install --without production. In above command, the --without production option prevents the local installation of any production gem means whatever gems are in the production group will not be installed -- which in our example is just one gem: pg .

What is bundle installation?

bundle install is a command we use to install the dependencies specified in your Gemfile.

Where does bundler install gems?

Show activity on this post. I know that when using gem install , the gem will be stored under /home/username/. rvm/gems/, under which gemset the gem was installed.

What is the difference between bundle install and bundle update?

The most common question I've heard about Bundler is about the difference between bundle install and bundle update . In a nutshell: bundle install handles changes to the Gemfile and bundle update upgrades gems that are already managed by Bundler.


1 Answers

The point of Bundler is to create a consistent gem environment across deployments. Gems, unfortunately, can interact even if they aren't loaded or required. So for maximum consistency, all gems should be installed, even if they aren't all required.

However, if you don't want all gems installed all the time, you can use the bundle install --without option.

like image 88
Mori Avatar answered Sep 27 '22 18:09

Mori