13

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
4

2 回答 2

23

我相信这是因为在您的项目文件夹中bundler创建了一个文件。.bundle/config该文件存储了--without production以后执行的选项,因此您不必每次都键入它。

于 2013-10-02T19:26:35.197 回答
1

当您在开发机器上运行 bundle 命令时,它不会安装 gems 以在您的生产环境中使用。

见这里: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...]]
于 2015-04-19T12:40:01.187 回答