Why doesn't the 'bundle install --without production' command not require '--without production' after update?

爱⌒轻易说出口 提交于 2019-12-21 07:54:49

问题


Why doesn't the second command of

$ bundle install

not need

--without production

(As this is how it went in a tutorial, so I assume its correct) What is happening/reasoning behind it not being needed?

From http://ruby.railstutorial.org/chapters/a-demo-app#sec-demo_users_resource

$ bundle install --without production
$ bundle update
$ bundle install

回答1:


I believe it's because bundler creates a .bundle/config file inside your project's folder. This file stores the --without production option for later execution so that you don't have to type it every time.




回答2:


When you run your bundle command on your development machine, it won't install the gems for use in your production environment.

See here: http://bundler.io/man/bundle-install.1.html

NAME
bundle-install - Install the dependencies specified in your Gemfile

SYNOPSIS

bundle install [--binstubs[=DIRECTORY]] [--clean] [--full-index] [--gemfile=GEMFILE] [--jobs=NUMBER] [--local] [--deployment] [--no-cache] [--no-prune] [--path PATH] [--system] [--quiet] [--retry=NUMBER] [--shebang] [--standalone[=GROUP[ GROUP...]]] [--trust-policy=POLICY] [--without=GROUP[ GROUP...]]


来源:https://stackoverflow.com/questions/19145162/why-doesnt-the-bundle-install-without-production-command-not-require-wit

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