【问题标题】:Why doesn't the 'bundle install --without production' command not require '--without production' after update?为什么'bundle install --without production' 命令在更新后不需要'--without production'?
【发布时间】:2013-10-02 19:23:25
【问题描述】:

为什么第二条命令没有

$ bundle install

不需要

--without production

(因为这是教程中的内容,所以我认为它是正确的) 不需要它背后的原因/原因是什么?

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

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

【问题讨论】:

    标签: ruby-on-rails ruby rubygems bundle


    【解决方案1】:

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

    【讨论】:

    • 我可以确认这一点。运行bundle install --without production 后,我发现.bundle/config 具有以下内容:---\nBUNDLE_WITHOUT: production
    【解决方案2】:

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

    请看这里: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...]]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-07-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-08
      相关资源
      最近更新 更多