![](/img/trans.png)
[英]bundler incorrectly trying to install “development” and “test” group gems in production
[英]Bundler: How can I configure a group of gems so that they are not downloaded in Production?
如何配置一組 gem,以便它們不會在生產中下載?
所以如果我有這個 Gemfile:
source 'http://rubygems.org'
gem 'rails'
gem 'facebook_oauth'
gem 'koala', '>=1.0.0.rc'
gem "jquery-rails"
gem 'faraday', '0.5.7'
group :development, :test do
gem "rspec-rails", ">= 2.0.0"
gem "steak"
gem 'launchy'
gem "capybara"
gem 'akephalos', :git => 'git://github.com/Nerian/akephalos.git'
end
標有:development 和:test 的 gem 不應該在 Production 中下載。
您想使用--without
選項運行捆綁程序bundler install
bundler install --without development test
更新關於 Heroku:
heroku config:add BUNDLE_WITHOUT="development:test"
您可以在此處找到更多 Heroku + Bundler 信息
通過 Capistrano 部署:
# config/deploy.rb
set :bundle_without, [:development, :test, :your_custom_group]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.