You have already activated rake 0.9.0, but your Gemfile requires rake 0.8.7

后端 未结 9 1527
孤街浪徒
孤街浪徒 2020-12-07 08:54

I\'m trying to run rails project, I get

Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

If I

相关标签:
9条回答
  • 2020-12-07 09:10

    I had this problem (with another gem that was not rake) and I was able to fix it by

    gem uninstall <complaining gem>
    gem install <complaining gem>
    
    bundle install
    bundle update
    

    Note that the keyword 'sudo' was not used (ie. sudo bundle install) as that may place your gem into directories where your rails app might not be searching in.

    0 讨论(0)
  • 2020-12-07 09:16

    If I understand what you're not asking, you need to open your Gemfile file and change the line...

    gem 'rake', '0.8.7'
    

    ...to...

    gem 'rake', '0.9.0'
    
    0 讨论(0)
  • 2020-12-07 09:18

    Rake 0.9.0 breaks rails.

    See here: Rake 0.9.0 'undefined method 'task' '

    Use bundle exec rake instead of rake to run rake at the correct version.

    0 讨论(0)
  • 2020-12-07 09:19

    Oh look, it's the future. For me, it was complaining I had rake 10.x installed when it wanted 0.9.5. Not quite sure, not familiar enough with Ruby to really dig into what happened to the recent version numbers, but what I did was:

    gem uninstall rake
    gem install rake -v 0.9.5
    

    to force the system to install the version of rake that the app wanted (for me it was Octopress).

    0 讨论(0)
  • 2020-12-07 09:22

    Where you are currently using rake commands like

    rake db:migrate
    

    Use this instead:

    bundle exec rake db:migrate
    

    this will be the case until the latest version of rails and/or rake work well together.

    0 讨论(0)
  • 2020-12-07 09:22

    I thank to Dobry Den, cheers dude. but little more I had to do. here is solution (works for me). I had added

    gem 'rake','0.8.7'
    

    on Gemfile, which was not there, but my new version of rails automatically install rake(0.9.0).

    after I had delete rake0.9.0 by gem uninstall rake and after doing bundle update rake , I can create and migrate database.

    0 讨论(0)
提交回复
热议问题