Rake 0.8.7和ActiveSupport 3.0.1

时间:2010-10-16 13:04:40

标签: ruby rake bundler activesupport

我正在运行Ruby 1.9.2。我安装了0.8k的rake。但是,在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)

4 个答案:

答案 0 :(得分:1)

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

要看的事情:

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

答案 1 :(得分:1)

我使用ruby-1.9.2遇到了类似的问题,并通过升级rubygems来修复它

sudo gem update --system

答案 2 :(得分:0)

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

答案 3 :(得分:0)

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