2011-04-28 65 views
1

如何配置一组宝石,使其不会在生产中下载?Bundler:如何配置一组宝石,以便它们不会在Production中下载?

所以,如果我有这样的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 

标明的宝石:开发:试验不应在生产下载。

回答

3

你想要的选项运行bundler install--without

bundler install --without development test 

更新 在问候的Heroku:

heroku config:add BUNDLE_WITHOUT="development:test" 

你可以找到更多的Heroku +捆扎机信息here

+0

不错,但这个应用程序的上下文的Heroku。你知道我怎么能在Heroku中设置它? – Nerian 2011-04-28 15:30:54

+1

@Nerian我用Heroku选项更新了答案 – nowk 2011-04-28 16:28:13

+0

非常感谢! – Nerian 2011-04-28 16:39:20

0

在部署通过Capistrano的:

# config/deploy.rb 

set :bundle_without, [:development, :test, :your_custom_group] 
相关问题