Nerian
Nerian

Reputation: 16177

Bundler: How can I configure a group of gems so that they are not downloaded in Production?

How can I configure a group of gems so that they are not downloaded in Production?

So if I have this 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

The gems marked with :development and :test should not be downloaded in Production.

Upvotes: 1

Views: 100

Answers (2)

rusllonrails
rusllonrails

Reputation: 5856

In deployment via Capistrano:

# config/deploy.rb

set :bundle_without, [:development, :test, :your_custom_group]

Upvotes: 0

nowk
nowk

Reputation: 33171

You want to run your bundler install with the option --without

bundler install --without development test

update In regards to Heroku:

heroku config:add BUNDLE_WITHOUT="development:test"

You can find more Heroku + Bundler info here

Upvotes: 3

Related Questions