Ruby on rails 运行迁移时发生Rails迁移错误?
当我执行Ruby on rails 运行迁移时发生Rails迁移错误?,ruby-on-rails,ruby,rake,Ruby On Rails,Ruby,Rake,当我执行rake db:migrate时,会出现以下错误: rake aborted! Gem::LoadError: You have already activated rake 10.2.2, but your Gemfile requires rake 10.1.0. Using bundle exec may solve this. 如何解决这个问题?当您试图通过Gemfile安装rake 10.1.0或明确提到它时,Gemfile中可能还有其他依赖于rake 10.2.2的Gem。
rake db:migrate
时,会出现以下错误:
rake aborted!
Gem::LoadError: You have already activated rake 10.2.2, but your Gemfile requires rake 10.1.0. Using bundle exec may solve this.
如何解决这个问题?当您试图通过Gemfile安装rake 10.1.0或明确提到它时,Gemfile中可能还有其他依赖于rake 10.2.2的Gem。查看您的GEM文件将有所帮助 如果您有特定的环境,您可能需要运行
bundle exec rake db:migrate
以确保正确运行它。可能:
bundle exec rake db:migrate
此错误是由于某些应用程序可能指定的gems版本与您安装的版本不同 尝试使用
bundle exec rake db:migrate
使用bundle exec
可确保程序在Gem文件中指定的环境下运行。根据,您还可以尝试删除gemfile.lock文件并重新运行bundle install
,以重新生成Gem依赖项