0

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.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.

Zabba
  • 64,285
  • 47
  • 179
  • 207
Sara
  • 69
  • 2
  • 10

3 Answers3

1

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.

ChuckJHardy
  • 6,956
  • 6
  • 35
  • 39
  • Thanks for your response. I did the following: C:\Ruby\New\Facebook>gem uninstall rake You have requested to uninstall the gem: rake-0.8.7 rails-2.3.11 depends on [rake (>= 0.8.3)] rails-2.3.8 depends on [rake (>= 0.8.3)] If you remove this gems, one or more dependencies will not be met. Continue with Uninstall? [Yn] Y Successfully uninstalled rake-0.8.7 C:\Ruby\New\Facebook>gem 'rake', '0.8.7' ERROR: While executing gem ... (RuntimeError) Unknown command rake, – Sara Jun 07 '11 at 06:15
  • So how do I install my rake file now as gem 'rake', '0.8.7' is not working – Sara Jun 07 '11 at 06:19
  • You need to put the gem 'rake', '0.8.7' in your Gemfile. If you want to install via the command line you need to gem install rake -v 0.8.7 – ChuckJHardy Jun 07 '11 at 06:42
  • Thanks. But its still not working so any more ideas are welcome – Sara Jun 07 '11 at 07:22
  • If you use Ruby 1.8.7 or Ree are you able to run Rake. If so then it is an issue with 2.3.x being out of date and will require patching. – ChuckJHardy Jun 07 '11 at 10:10
  • Thanks, this solved a similar problem for me. I was getting: `WARNING: DSL method Object#sh called at C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/file_utils_ext.rb:36:in 'sh' rake aborted! Finished features had failing steps C:/.../stories/rakefile:19:in 'block in '` – Daniel Robinson Jul 14 '11 at 11:42
0

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)

Erik Peterson
  • 4,281
  • 1
  • 22
  • 32
  • Well there is no change in the error after I upgrade. Can you please suggest something else or to which version should I upgrade? – Sara Jun 07 '11 at 05:40
0

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.

  • Thanks for your response. My current gem list is as follows but how do I make it a valid gem list C:\Ruby\New\Facebook>gem list *** LOCAL GEMS *** actionmailer (2.3.11, 2.3.8) actionpack (2.3.11, 2.3.8) activerecord (2.3.11, 2.3.8) activeresource (2.3.11, 2.3.8) activesupport (2.3.11, 2.3.8) minitest (1.6.0) mysql (2.8.1 x86-mingw32) rack (1.1.2) rails (2.3.11, 2.3.8) rake (0.8.7) rdoc (2.5.8) rubygems-update (1.8.5, 1.5.2) – Sara Jun 07 '11 at 06:59
  • do you have data base created for your project? – Malik Arsalan Tahir Jun 07 '11 at 07:56