instance method gem

Ruby on Rails 3.0.20

Since v3.0.20 Last seen in v3.0.20

Signature

gem(name, options = {})

Rails 3, by default, uses bundler, which shims the Kernel#gem method so that it should behave correctly for this deprecation.

Parameters

name req
options opt = {}
Source
# File railties/lib/rails/engine/configuration.rb, line 70
      def gem(name, options = {})
        super name, options[:version] || ">= 0"
        require options[:lib] || name
      rescue Gem::LoadError
        msg = "config.gem is deprecated, and you tried to activate the '#{name}' gem (#{options.inspect}) using it.\n"

        if File.exist?("#{Rails.root}/Gemfile")
          msg << "Please add '#{name}' to your Gemfile."
        else
          msg << "Please update your application to use bundler."
        end
        ActiveSupport::Deprecation.warn(msg, caller)
        exit
      end

Defined in railties/lib/rails/engine/configuration.rb line 70 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Rails::Engine::Configuration

Type at least 2 characters to search.

↑↓ navigate · open · esc close