Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does bundle install --without production do?

Ive seen people using this and used it myself as told to do so. I just dont have a real grasp as what it actually does. I understand fully the bundle install part, but not the --without production part of it. What does this do and why would I want to use it?

like image 448
Ordep81 Avatar asked Nov 10 '13 21:11

Ordep81


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 the goal of running bundle install?

Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed. Bundler is an exit from dependency hell, and ensures that the gems you need are present in development, staging, and production. Starting work on a project is as simple as bundle install .

What is the difference between bundle and bundle install?

The commands bundle & bundle install also have the same functionality. bundle uses Thor, and bundle 's default task is install . Also, bundle i does the same thing as bundle install because bundle 's task i is mapped (aliased) to install .

What is the difference between bundle install and bundle update?

bundle update and bundle install can both install the gems you specified in Gemfile but missing in gems. But bundle update does one thing more to upgrade: If the gems specified in Gemfile don't have version, it will upgrade to whatever latest.


1 Answers

As you seen some people using following command(Which you said in your question):

bundle install --without production

--without production is a special flag which we are using.

For more explanation I am taking following example:

group :production do
  gem 'pg', '0.12.2'
end

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.

like image 172
Jaimin pandya Avatar answered Oct 19 '22 10:10

Jaimin pandya