Frequently Asked Questions

Help Center Search

Specifying Gem Versions

Print this Article
Comment on this Article
Last Updated: February 19, 2007 9:21 AM

The require_gem command is used in your config/environment.rb file to specify the Gem version you want loaded for your application. Its syntax is shown below, using the Gem "actionpack" as an example:

require_gem 'actionpack', '= 1.11.2'

To specify a range of versions, the following syntax is used:

require_gem 'actionpack', '~> 1.11'

When the version number is omitted, the latest Gem version is loaded.