instance method gem

Ruby on Rails 2.2.3

Since v2.2.3 Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

gem(name, options = {})

Adds a single Gem dependency to the rails application. By default, it will require the library with the same name as the gem. Use :lib to specify a different name.

# gem 'aws-s3', '>= 0.4.0'
# require 'aws/s3'
config.gem 'aws-s3', :lib => 'aws/s3', :version => '>= 0.4.0', \
  :source => "http://code.whytheluckystiff.net"

To require a library be installed, but not attempt to load it, pass :lib => false

config.gem 'qrp', :version => '0.4.1', :lib => false

Parameters

name req
options opt = {}
Source
# File railties/lib/initializer.rb, line 731
    def gem(name, options = {})
      @gems << Rails::GemDependency.new(name, options)
    end

Defined in railties/lib/initializer.rb line 731 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Rails::Configuration

Type at least 2 characters to search.

↑↓ navigate · open · esc close