获取:“迁移正在等待中;运行“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

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

问题描述

我克隆了我的项目.与bundle install"捆绑在一起,然后运行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".

这就是我在执行

我在开发环境.如果您需要任何其他信息,请告诉我.

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"作为burninggramma"的建议.

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

任何导致错误的线索?

推荐答案

有趣.你运行了 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 bundle exec 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天全站免登陆