正在获得:“迁移正在等待;运行“ bin / rake db:migrate RAILS_ENV = development”来解决此问题。克隆并迁移项目后 [英] Getting: "Migrations are pending; run 'bin/rake db:migrate RAILS_ENV=development' to resolve this issue." after cloning and migrating the project

查看:155
本文介绍了正在获得:“迁移正在等待;运行“ bin / rake db:migrate RAILS_ENV = development”来解决此问题。克隆并迁移项目后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我克隆了我的项目。与捆绑安装捆绑在一起,然后运行 rake db:migrate。我收到此错误:(当我运行Rails服务器并打开浏览器到localhost:3000时)迁移正在等待;运行'bin / rake db:migrate RAILS_ENV = development'解决此问题。

I cloned my project. Bundled with "bundle install", then run "rake db:migrate". I am getting this error: (when I run the rails server and open my browser to localhost:3000) "Migrations are pending; run 'bin/rake db:migrate RAILS_ENV=development' to resolve this issue."

我一个接一个地检查了所有迁移,所有迁移都没有错误。执行 rake db:migrate后也没有显示错误。

I checked all migrations one by one and all were executed without errors. Also no errors were shown after the execution of "rake db:migrate".

这就是我执行 rake db:migrate:status

我在开发环境中。请让我知道是否需要其他信息。

I am on development environment. Please let me know if you need any other information.

我还尝试了 bundle exec rake db:migrate和 bundle exec rake db:migrate:reset作为

I also tried "bundle exec rake db:migrate", and "bundle exec rake db:migrate:reset" as "burninggramma" suggested.

任何线索导致错误的原因是什么?

Any clues what causes the error?

推荐答案

有趣。您是否运行过 rake db:create ?假设您正在使用sqlite3,请执行以下操作:

Interesting. Did you run rake db:create? Assuming you are using sqlite3, do this:

      rm -f db/*.sqlite3
      rake db:create
      RAILS_ENV=development rake db:migrate
      rails s -e development

您可以列出您的 config / database.yml 文件的内容吗?

Also, can you list the contents of your config/database.yml file?

编辑:警告!显然,您将丢失现有数据。

Warning! Obviously, you will lose your existing data.

这篇关于正在获得:“迁移正在等待;运行“ bin / rake db:migrate RAILS_ENV = development”来解决此问题。克隆并迁移项目后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆