无法使用rake db:migrate

时间:2018-06-14 08:03:13

标签: ruby-on-rails migration rake

当我尝试通过 rake db:migrate 应用迁移时,出现以下错误:

rake aborted!
Gem::LoadError: You have already activated rake 12.0.0, but your 
Gemfile requires rake 10.4.2. Prepending `bundle exec` to your command 
may solve this.
/home/jeyjeyanischixx/CaprisePro/config/boot.rb:3:in `<top (required)>'
/home/jeyjeyanischixx/CaprisePro/config/application.rb:1:in `<top (required)>'
/home/jeyjeyanischixx/CaprisePro/Rakefile:4:in `<top (required)>'
/home/jeyjeyanischixx/.rvm/gems/ruby-2.4.1@global/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'

然后当我在此命令之前添加bundle exec时,我得到了这个:

Could not find nokogiri-1.8.2 in any of the sources
Run `bundle install` to install missing gems.

但我已经成功安装了所有宝石(包括nokogiri和rake两个版本(10.4.2和12.0.0))。

Rails:4.2.10; Ruby:2.4.1

0 个答案:

没有答案