如何以多种方式安装宝石的方式运行bundle --without?

时间:2015-08-19 07:56:32

标签: ruby-on-rails ruby gem bundler gemfile

如果您在此gemfile上运行bundle --without development test,它将不会安装bcrypt,因为它出现在具有开发成员的组中。你如何指定bundle来安装bcrypt而不是其他组呢?

gem "rails"

group :production, :development do
  gem "bcrypt"
end

group :development do
  gem "better_errors"
end

group :development, :test do
  gem "selenium-webdriver"
end

编辑:或者,这是一种更好的方式来构建文件,以避免bcrypt被包含在测试中?

1 个答案:

答案 0 :(得分:1)

我会将它添加到Gemfile中,如下所示:

# Gemfile
gem 'newrelic_rpm'

然后在test.rb中禁用它。有关详细信息,请参阅此处:https://docs.newrelic.com/docs/agents/ruby-agent/troubleshooting/controlling-when-ruby-agent-starts