2

好吧,这很奇怪。我正在尝试进行数据库迁移,突然之间,我收到了这些错误:

[C:\source\fe]: rake db:migrate --trace
(在 C:/source/fe 中)
** 调用 db:migrate (first_time)
** 调用设置(first_time)
** 调用 gems:install (first_time)
** 调用 gems:set_gem_status (first_time)
** 执行 gems:set_gem_status
** 执行 gems:install
耙中止!
无法激活 rake (> 0.0.0),已激活 rake-0.8.3]
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:139:in `activate'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:155:in `activate'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:154:in `每个'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:154:in `activate'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:49:in `gem'
C:/source/fe/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:36:in `add_load_paths'
C:/source/fe/config/../vendor/rails/railties/lib/initializer.rb:245:in `add_gem_load_paths'
C:/source/fe/config/../vendor/rails/railties/lib/initializer.rb:245:in `each'
C:/source/fe/config/../vendor/rails/railties/lib/initializer.rb:245:in `add_gem_load_paths'
C:/source/fe/config/../vendor/rails/railties/lib/initializer.rb:97:in `send'
C:/source/fe/config/../vendor/rails/railties/lib/initializer.rb:97:in `run'
C:/source/fe/config/gems.rb:45:in `init_dependencies'
C:/source/fe/lib/tasks/overridegems.rake:15
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
c:/ruby/lib/ruby/1.8/monitor.rb:242:in `同步'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:in `invoke_prerequisites'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `invoke_prerequisites'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in `invoke_with_call_chain'
c:/ruby/lib/ruby/1.8/monitor.rb:242:in `同步'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:in `invoke_prerequisites'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `invoke_prerequisites'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in `invoke_with_call_chain'
c:/ruby/lib/ruby/1.8/monitor.rb:242:in `同步'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
c:/ruby/bin/rake:19:in `load'
c:/ruby/bin/rake:19
[C:\源\fe]:

有什么建议么?我试过卸载和重新安装 rake,以及更新 rails。

仅供参考,我使用的是 Gem 1.1.1。

我还尝试过 gem update rails、gem update rake 和其他任何东西。

4

3 回答 3

4

Interestingly, the solution here was that i needed to downgrade my rake version. The local version (in my C:\ruby dir) was overriding the one in the source directory, and couldn't be loaded. I had done gem update and updated all my local gems.

命令是:

gem uninstall rake
gem install rake -v ('= 1.5.1')
于 2008-11-17T18:57:37.530 回答
1

I had a problem similar to this, which I ended up working around by hacking my rails version to not initialize active resource (by modifying the components method in /rails/railties/builtin/rails_info/rails/info.rb )

This is clearly a hack, but I didn't have a chance to work out why active_resource specifically was causing the rake conflict, and since I wasn't using active_resource anyway, it got me through the night.

于 2008-11-07T18:40:49.370 回答
-4
rake aborted!
can`'t activate rake

It is mid-Autumn - perhaps too many leaves have fallen and the rake can't be used. Try using the leaf-blower instead.

Next time, keep up with the raking to prevent this.

于 2008-10-29T00:11:21.360 回答