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?
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 .
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 .
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 .
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.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With