如何在Gemfile中安装生产组

时间:2015-06-12 11:52:13

标签: ruby-on-rails ruby ruby-on-rails-4 gem rubygems

我的宝石文件包含:

group :production do
  gem 'pg',             '0.17.1'
  gem 'rails_12factor', '0.0.2'
  gem 'puma',           '2.11.1'
end

当我给出bundle install命令时,最后我得到了行

"Your bundle is complete!
Gems in the group production were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed."

如何安装生产组。?

2 个答案:

答案 0 :(得分:7)

在你的.bundle/config文件中,你可能有这一行:

BUNDLE_WITHOUT: production

只需删除此行,bundle install也会安装来自production群组的宝石

答案 1 :(得分:1)

按照以下步骤操作

  1. bundle install --without development
  2. bundle install #remembers and includes --without development
  3. bundle install --without nothing
  4. 现在捆绑商安装所有宝石。

    或者你可以直接尝试这个只安装生产组的宝石,

    bundle install --without development test