Boot.rb中的Fedena错误

时间:2013-10-09 06:32:07

标签: ruby-on-rails ruby fedena

  

/home/palpandi/.rvm/gems/ruby-1.8.7-p374@fedena_zip/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning:   不推荐使用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

2 个答案:

答案 0 :(得分: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

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

答案 1 :(得分: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行(在'rubygems'之后)