instance method install_gem_spec_stubs

Ruby on Rails 2.3.18

Since v2.2.3 Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

install_gem_spec_stubs()

If Rails is vendored and RubyGems is available, install stub GemSpecs for Rails, Active Support, Active Record, Action Pack, Action Mailer, and Active Resource. This allows Gem plugins to depend on Rails even when the Gem version of Rails shouldn’t be loaded.

Source
# File railties/lib/initializer.rb, line 217
    def install_gem_spec_stubs
      unless Rails.respond_to?(:vendor_rails?)
        abort %{Your config/boot.rb is outdated: Run "rake rails:update".}
      end

      if Rails.vendor_rails?
        begin; require "rubygems"; rescue LoadError; return; end

        stubs = %w(rails activesupport activerecord actionpack actionmailer activeresource)
        stubs.reject! { |s| Gem.loaded_specs.key?(s) }

        stubs.each do |stub|
          Gem.loaded_specs[stub] = Gem::Specification.new do |s|
            s.name = stub
            s.version = Rails::VERSION::STRING
            s.loaded_from = ""
          end
        end
      end
    end

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

Defined in Rails::Initializer

Type at least 2 characters to search.

↑↓ navigate · open · esc close