2011-06-07 78 views
0

我已經升級到rails 2.3.11和ruby 1.9.2,因爲我的一些寶石與以前的版本不兼容。現在我無法執行rake命令。當我做耙寶石時出現以下錯誤:install或rake db:migrate。更新rails版本後無法運行rake

(in C:/Ruby/New/Facebook) 
rake aborted! 
can't convert Symbol into Integer 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/rails/gem_dependency.rb:53: 
in `[]' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/rails/gem_dependency.rb:53: 
in `initialize' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/initializer.rb:836:in `new' 

C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/initializer.rb:836:in `gem' 

C:/Ruby/New/Facebook/config/environment.rb:22:in `block in <top (required)>' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/initializer.rb:111:in `run' 

C:/Ruby/New/Facebook/config/environment.rb:9:in `<top (required)>' 
<internal:lib/rubygems/custom_require>:29:in `require' 
<internal:lib/rubygems/custom_require>:29:in `require' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.11/lib/active_support/depe 
ndencies.rb:182:in `block in require' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.11/lib/active_support/depe 
ndencies.rb:547:in `new_constants_in' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-2.3.11/lib/active_support/depe 
ndencies.rb:182:in `require' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rails-2.3.11/lib/tasks/misc.rake:4:in `block 
in <top (required)>' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `call' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `block in execute' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `each' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `execute' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain' 
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:605:in `block in invoke_prerequisites' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:602:in `each' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:602:in `invoke_prerequisites' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:594:in `block in invoke_with_call_chain' 
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:581:in `invoke' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `each' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2013:in `top_level' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:1992:in `run' 
C:/Ruby192/bin/rake:31:in `<main>' 

請幫助我,因爲我被卡住了幾天。

回答

0

您可能需要升級rubygems-update。

運行gem -v查看您當前的版本號。

運行gem update --system升級rubygems。 (您可能需要須藤根據您的設置)

要恢復到以前的版本,運行gem update --system 1.3.7(交換1.3.7之前的版本號)

+0

那麼升級後錯誤沒有變化。您可以請其他建議或我應該升級哪個版本? – Sara 2011-06-07 05:40:42

1

看起來像瑞克版本的問題給我。試試這個...

gem uninstall rake # select all options 
gem 'rake', '0.8.7' # Gemfile 
bundle install 
run you rake command 

配售這行代碼在你.rvmrc您的根目錄將允許您跳過小錯誤這樣的未來。

bundle exec $SHELL 

所有最好的,讓我們知道你是如何得到。

+0

感謝您的回覆。我做了以下操作: C:\ Ruby \ New \ Facebook> gem卸載rake 您已經請求卸載gem: rake-0.8.7 rails-2.3.11取決於[rake(> = 0.8.3 )] rails-2.3.8取決於[rake(> = 0.8.3)] 如果刪除這些寶石,將不會滿足一個或多個依賴關係。 繼續卸載? [Yn] Y 成功卸載rake-0.8.7 C:\ Ruby \ New \ Facebook> gem'rake','0.8.7' 錯誤:執行gem時(RuntimeError) 未知命令rake, – Sara 2011-06-07 06:15:36

+0

那麼現在如何安裝我的rake文件,因爲寶石'rake','0.8.7'不起作用 – Sara 2011-06-07 06:19:32

+0

您需要將gem'rake','0.8.7'放入您的Gemfile中。如果你想通過命令行安裝,你需要安裝rake -v 0.8.7 – CharlesJHardy 2011-06-07 06:42:02

0

你應該想辦法解決寶石引發耙子的衝突。嘗試運行服務器,如果你成功了,這意味着你可以運行Rake,它與Rake版本befre運行rake無關,爲rails提供一個有效的gem列表。

+0

感謝您的回覆。我目前的寶石列表如下,但我如何使它成爲一個有效的寶石名單 C:\ Ruby \ New \ Facebook>寶石名單 ***本地GEMS *** actionmailer(2.3.11,2.3.8 (2.3.11,2.3.8) activesupport(2.3.11,2.3.8) activerecord(2.3.11,2.3.8) activeresource(2.3.11,2.3.8) 0) MySQL的(2.8.1 x86的的mingw32) 機架(1.1.2) 軌(2.3.11,2.3.8) 耙(0.8.7) 的RDoc(2.5.8) 的rubygems更新(1.8 .5,1.5.2) – Sara 2011-06-07 06:59:27

+0

您是否有爲您的項目創建的數據庫? – 2011-06-07 07:56:57

相關問題