What does bundle install --without production do?

余生颓废 提交于 2020-01-22 19:59:07

问题


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?


回答1:


If you have a group inside your Gemfile like

group :production do
    gem 'whatever'
end

Then when you run your bundle command on your development machine, it won't install the gems intended for use in your production environment. Basically only installing the gems you need in development on your development machine.




回答2:


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.



来源:https://stackoverflow.com/questions/19895395/what-does-bundle-install-without-production-do

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!