rake db:migrate 迁移错误

migration error with rake db:migrate

我创建了一个新模型,但是当我运行 rake db: migrate 命令时,它会提示我以下错误:

rake aborted!
Gem::LoadError: You have already activated rake 10.4.0, but your Gemfile requires rake 
10.3.2. Prepending `bundle exec` to your command may solve this.
/Users/yedidyaweiner/projects/music-app/config/boot.rb:4:in `<top (required)>'
/Users/yedidyaweiner/projects/music-app/config/application.rb:1:in `<top (required)>'
/Users/yedidyaweiner/projects/music-app/Rakefile:4:in `<top (required)>'
LoadError: cannot load such file -- bundler/setup
/Users/yedidyaweiner/projects/music-app/config/boot.rb:4:in `<top (required)>'
/Users/yedidyaweiner/projects/music-app/config/application.rb:1:in `<top (required)>'
 /Users/yedidyaweiner/projects/music-app/Rakefile:4:in `<top (required)>'

(See full trace by running task with --trace)

我做错了什么?

使用

bundle exec rake db:migrate

您还可以通过 运行

更新您的宝石
bundle update

执行以下命令

a) 删除您的 Gemfile.lock 文件

b) 捆绑安装

它应该用正确的耙子更新 Gemfile.lock。

a) gem 卸载 rake -v 10.4.0

b) gem 安装 rake -v 10.3.2


然后尝试 运行 'rake db:migrate'。它应该工作。