rake db:migrate 不起作用,让我回到命令行 Rails 3.1.1

发布于 2024-12-20 07:09:02 字数 595 浏览 2 评论 0原文

暂停后,使用rails3.1.1 for windows和railsinstaller

>rake db:migrate

,让我直接回到命令行。没有错误,没有消息,直接返回命令行。

我试过了,

>rake --trace db:migrate

** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment 
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
** Invoke db:schema:dump (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:schema:dump

看起来没有什么问题,但显然有些东西不正常。

有人可以帮忙吗?

Using rails 3.1.1 for windows with railsinstaller

>rake db:migrate

after a pause, brings me right back to the command line. No errors, no messages, just right back to the command line.

I tried

>rake --trace db:migrate

** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment 
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
** Invoke db:schema:dump (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:schema:dump

Doesn't look like anything is wrong, but obviously something isn't working right.

Can anyone help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蹲墙角沉默 2024-12-27 07:09:02

如果没有要运行的迁移,则不会有输出。 --trace 命令输出 rake 在迁移后准备、执行和清理所经历的各个步骤。但是,当它发现没有要运行的迁移时,它实际上不会进行任何数据库更改。只有数据库更改才会导致额外的输出。

这与迁移之间的唯一区别是对数据库的更改将输出到命令行。没有变化=>无输出。

If there are no migrations to be run, there will be no output. The --trace command outputs the various steps that rake goes through to prepare, execute, and clean up after the migration. However, when it sees that there is no migration to be run, then it doesn't actually make any DB changes. Only DB changes cause additional output.

The only difference between this and a migration is that the changes to the DB will be output to the command line. No changes => no output.

走过海棠暮 2024-12-27 07:09:02

确保您位于正确的文件夹中(使用 git 时可能位于正确的分支中)并确保您已创建迁移文件。

rails generate migration MigrationName

根据需要编辑生成的文件。

Make sure you are in the right folder (maybe in the right branch, when using git) and make sure that you have created a migration file.

rails generate migration MigrationName

Edit the generated file as you wish.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文