迁移待定;运行“bin/rake db:migrate RAILS

编程入门 行业动态 更新时间:2024-10-24 08:26:29
本文介绍了迁移待定;运行“bin/rake db:migrate RAILS_ENV=development"来解决这个问题[无法继续]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我似乎有一个关于 Ruby on Rails 迁移过程的循环问题.我正在关注介绍文章,我已经到了需要创建第一个表的地步.

I appear to have a circular issue in regards to Ruby on Rails migration procedure. I am following the introduction article and I have reached the point when I need to create my first table.

我已经运行了以下,

[tims@web2 working_ror]# rails generate model Homepage first_name:string last_name:string email:string message:text invoke active_record create db/migrate/20131119203948_create_homepages.rb create app/models/homepage.rb invoke test_unit createtest /models/homepage_test.rb createtest /fixtures/homepages.yml

然后我继续进行迁移,

[tims@web2 working_ror]# rake db:migrate == CreateHomepages: migrating ================================================ -- create_table(:homepages) -> 0.0493s == CreateHomepages: migrated (0.0494s) =======================================

但是,当我运行我的应用程序时,我看到以下消息,

, however, when I run my application I see the following message,

Migrations are pending; run 'bin/rake db:migrate RAILS_ENV=development' to resolve this issue.

但是,如果我运行上面的代码,

but, IF I run the above,

[tims@web2 working_ror]# rake db:migrate RAILS_ENV=development [tims@web2 working_ror]#

消息还在继续......

and the message continues ...

我花了大量时间研究论坛——我能找到的最接近的方法是删除并重新构建所有内容,这些论坛做了以下工作.

I have spent considerable amount of time researching forums in-which the closest I could find was to drop and re-build everything, which have done the following.

耙分贝:下降耙数据库:创建耙数据库:迁移

rake db:drop rake db:create rake db:migrate

结果是一样的.

推荐答案

你需要做的

bundle exec rake test:prepare

bundle exec rake db:test:prepare

然后

bundle exec rake db:migrate

在运行规范之前

干杯

引自:为什么我会被问到运行'rake db:migrate RAILS_ENV=test'?

更多推荐

迁移待定;运行“bin/rake db:migrate RAILS

本文发布于:2023-10-28 13:30:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1536772.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:待定   bin   rake   RAILS   migrate

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!