A super simple little nifty argument to bundler to skip installing gems for production. On my development machine (currently my Macbook) I don’t have MySQL set up nor do I feel the need to right now. Maybe when the project goes live, becomes more complex or I need to start optimizing I’ll go for MySQL instead of SQLite3. So my Gemfile is basically this:

source 'http://rubygems.org'

gem 'rails', '3.1.0.rc4'

# Asset template engines
gem 'sass-rails', "~> 3.1.0.rc"
gem 'coffee-script'
gem 'uglifier'
gem 'jquery-rails'

group :test do
	gem 'sqlite3'
	gem 'rspec', '~> 2.4'
	gem 'rspec-rails'
end

group :development do
	gem 'sqlite3'
	gem 'rspec', "~> 2.4"
end

group :production do
	gem 'mysql'
end

Running bundle install without the proper MySQL-stuff installed we’ll get an error, so how do we skip the production gems?


bundle install --without production