Gem Dependencies

The Brightbox deployment gem can be configured to auto install any gems that your app needs.

Automatic gem installation with bundler

If you're using Bundler with your app (recommended, and default with Rails 3+) then you don't need to do anything, the gem will handle things automatically.

Manual gem installation

If you aren't using Bundler, the following explains how to configure gem dependencies. The deployment gem does not try to auto install gems listed in your environment.rb, as this caused too many problems with misbehaving Rails plugins.

So, to get your gems installed automatically, list them in config/deploy.rb using the Capistrano depends mechanism. You can specify exact versions if you need to. For example:

depend :remote, :gem, "rails", "2.3.2"
depend :remote, :gem, "ferret", "0.11.6"
depend :remote, :gem, "rmagick", ">=2.7"

You can also specify an alternative source, such as github:

depend :remote, :gem, "mislav-will_paginate", ">=2.3", :source => "http://gems.github.com"

If you don't care which version of a gem is installed, you can just pass a greater than zero version number:

depend :remote, :gem, "eventmachine", ">0"
docs/gemv2/gem_dependencies.txt · Last modified: 2010/09/09 10:05 by johnleach