[英]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)捆绑安装
它应该使用正确的rake更新Gemfile.lock。
要么
a)gem uninstall rake -v 10.4.0
b)gem install rake -v 10.3.2
然后尝试运行'rake db:migrate'。 它应该工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.