0

/home/palpandi/.rvm/gems/ruby-1.8.7-p374@fedena_zip/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:警告:Gem::Dependency#version_requirements 已弃用,将在 2010 年 8 月或之后删除。使用#requirement

/home/palpandi/.rvm/gems/ruby-1.8.7-p374@fedena_zip/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:105:in `const_missing': 未初始化的常量 Rails::Boot: :Bundler (NameError)

使用 Rails 2.3.5 Ruby 1.8.7 ubuntu 12.04

4

2 回答 2

1

我有一个类似的问题。解决此问题的正确方法是转到您的项目文件夹,然后config/boot.rb转到最底部,并在该Rails.boot!行之前添加以下内容:

begin
 require "rubygems"
 require "bundler"
rescue Bundler::GemNotFound
   raise RuntimeError, "Bundler couldn't find some gems." + "Did you run bundle install?"
end

class Rails::Boot
  def run
    load_initializer

    Rails::Initializer.class_eval do
      def load_gems
        @bundler_loaded ||= Bundler.require :default, Rails.env
      end
    end

    Rails::Initializer.run(:set_load_path)
  end
end

这将解决“未初始化的常量授权”错误。

于 2015-08-08T23:53:16.630 回答
0

将此行放入您的 boot.rb

begin
 require "rubygems"
 require "bundler"
rescue Bundler::GemNotFound 
   raise RuntimeError, "Bundler couldn't find some gems." + "Did you run bundle install?"
end

或者

gem install bundler

并添加后:

gem 'bundler'

在 config/boot.rb 的第 2 行(就在 require 'rubygems' 之后)

于 2013-10-09T07:45:42.227 回答