无法激活佣金(> 0.0.0)?

时间:2008-10-29 00:07:36

标签: ruby-on-rails ruby rake

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

[C:\source\fe]: rake db:migrate --trace
(in C:/source/fe)
** Invoke db:migrate (first_time)
** Invoke setup (first_time)
** Invoke gems:install (first_time)
** Invoke gems:set_gem_status (first_time)
** Execute gems:set_gem_status
** Execute gems:install
rake aborted!
can`'t activate rake (> 0.0.0), already activated 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 `each'
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 `synchronize'
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 `synchronize'
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 `synchronize'
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:\source\fe]:

有什么建议吗?我已经尝试卸载并重新安装rake,以及更新rails。

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

我也尝试过gem update rails,gem update rake以及其他任何东西。

3 个答案:

答案 0 :(得分:4)

有趣的是,这里的解决方案是我需要降级我的rake版本。本地版本(在我的C:\ ruby​​目录中)覆盖了源目录中的版本,无法加载。我做了宝石更新并更新了我所有的本地宝石。

命令是:

gem uninstall rake
gem install rake -v ('= 1.5.1')

答案 1 :(得分:1)

我遇到了类似的问题,我最终通过黑客攻击我的rails版本来初始化活动资源(通过修改/rails/railties/builtin/rails_info/rails/info.rb中的组件方法)< / p>

这显然是一个黑客,但我没有机会弄清楚为什么active_resource特别导致rake冲突,因为我还没有使用active_resource,它让我度过了整个晚上。

答案 2 :(得分:-4)

rake aborted!
can`'t activate rake

这是中秋 - 也许太多的树叶已经掉落而且耙子不能使用。请尝试使用吹叶机。

下次,跟上晃动以防止这种情况发生。