开发者

Unable to run rake after updating rails versions

I have upgraded to rails 2.3.11 and and ruby 1.9.2 as some of my gems were incompatible with previous version. Now I am unable to execute rake command. I am getting following error when i do rake gems:install or rake db:migrate.

(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.开发者_Go百科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>'

Please help me as I am stuck on it for few days.


Looks like a Rake version issue to me. Try this...

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

Placing this line of code in your .rvmrc in your root directory will allow you to skip little error like this in the future.

bundle exec $SHELL

All the best, let us know how you get on.


It's possible that you need to upgrade rubygems-update.

Run gem -v to see your current version number.

Run gem update --system to upgrade rubygems. (you may need to sudo depending on your setup)

To revert to your previous version, run gem update --system 1.3.7 (swap 1.3.7 for the previous version number)


You are suppose to resolve the conflicts of gems befre initiate rake. try running server if you get succeeded it means you can run Rake as well it has nothing to do with Rake version befre running rake make a valid gem list for rails.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜