rake aborted! You have already activated rake 10.0.2, but your Gemfile requires rake 0.9.2.2

前端 未结 8 810
终归单人心
终归单人心 2021-01-31 17:33

I am trying to do \"rake db:migrate\" and it is giving me this error.

Andy:AcademyAir Andy$ rake db:migrate
/Users/Andy/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.         


        
8条回答
  •  旧时难觅i
    2021-01-31 18:08

    It happens because you are using rake from the system. (latest version by default) The solution is use follow command:

    bundle exec rake db:migrate
    

    Also, you can create alias. Because this command is too big and difficult to write.

    echo "alias be='bundle exec'" >> ~/.bash_profile
    source ~/.bash_profile
    

    Then you can use follow short command:

    be rake db:migrate
    

提交回复
热议问题