【问题标题】:Rake 0.8.7 and ActiveSupport 3.0.1耙子 0.8.7 和 ActiveSupport 3.0.1
【发布时间】:2010-10-16 13:04:39
【问题描述】:

我正在运行 Ruby 1.9.2。我已经安装了 rake 0.8.7。但是在 Rails 应用程序中运行 rake 会得到以下结果:

(in /usr/home/users/dimitar/Rails/spek)
Could not find activesupport-3.0.1 in any of the sources
Try running `bundle install`.

所以我继续运行bundle install,一切看起来都很好:

Fetching source index for http://rubygems.org/
Using rake (0.8.7) 
Using abstract (1.0.0) 
Using activesupport (3.0.1) 
Using builder (2.1.2) 
Using i18n (0.4.1) 
Using activemodel (3.0.1) 
Using erubis (2.6.6) 
Using rack (1.2.1) 
Using rack-mount (0.6.13) 
Using rack-test (0.5.6) 
Using tzinfo (0.3.23) 
Using actionpack (3.0.1) 
Using mime-types (1.16) 
Using polyglot (0.3.1) 
Using treetop (1.4.8) 
Using mail (2.2.7) 
Using actionmailer (3.0.1) 
Using arel (1.0.1) 
Using activerecord (3.0.1) 
Using activeresource (3.0.1) 
Using bundler (1.0.3) 
Using thor (0.14.3) 
Using railties (3.0.1) 
Using rails (3.0.1) 
Using sqlite3-ruby (1.3.1) 
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.

但是rake 仍然给我同样的错误信息。有什么建议吗?


其实问题似乎来自于config/boot.rb文件:

# Set up gems listed in the Gemfile.                                                                                                                               
gemfile = File.expand_path('../../Gemfile', __FILE__)
begin
  ENV['BUNDLE_GEMFILE'] = gemfile
  require 'bundler'
  Bundler.setup
rescue Bundler::GemNotFound => e
  STDERR.puts e.message
  STDERR.puts "Try running `bundle install`."
  exit!
end if File.exist?(gemfile)

【问题讨论】:

    标签: ruby rake bundler activesupport


    【解决方案1】:

    您是否安装了多个 Ruby 解释器(可能通过 rvm 或其他方法)?如果是这样,你确定正确的那个是活跃的吗?

    看点:

    which ruby
    which rake
    ruby -e 'puts $:' # To show the LOAD_PATH for gems
    

    【讨论】:

    • 我确实安装了 Ruby 1.8.7,但它根本没有被使用。一切似乎都还好。如果我在 Gemfile 中指定 rails 3.0.0,一切正常。
    • @daLizard 根据您的跟进和这个,这听起来像是一个 Bundler 特定的问题。您可以尝试进一步检查其文档gembundler.com
    • 我现在正在检查文档。还通过电子邮件发送了讨论列表。是的,对我来说似乎是 Bundler 问题。虽然可能是 FreeBSD 特定的,因为它可以在具有相同版本 gems 的 MacOS 上运行。
    【解决方案2】:

    我在使用 ruby​​-1.9.2 时遇到了类似的问题,并通过升级 ruby​​gems 修复了它

    sudo gem 更新 --system

    【讨论】:

      【解决方案3】:

      我在使用 REE 1.8.7 时遇到了同样的问题。我切换到 1.9.2 并进行了捆绑安装。然后我的 rake 命令起作用了。

      【讨论】:

        【解决方案4】:

        当我错误地使用 ruby​​ 1.9.3 运行乘客并且应用程序在其 .rvmrc 中使用 1.8.7 时,我遇到了这个问题。通过使用 1.9.3 修复(现在我遇到了编码问题,但那是另一回事)。

        【讨论】:

          猜你喜欢
          • 2010-09-19
          • 2011-09-16
          • 2011-11-19
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2022-07-14
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多