Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql Phusion乘客-ActiveRecord::PendingMigrationError_Mysql_Ruby On Rails_Ruby_Linux_Activerecord - Fatal编程技术网

Mysql Phusion乘客-ActiveRecord::PendingMigrationError

Mysql Phusion乘客-ActiveRecord::PendingMigrationError,mysql,ruby-on-rails,ruby,linux,activerecord,Mysql,Ruby On Rails,Ruby,Linux,Activerecord,我正在尝试使用Phusion Passenger运行简单的RoR应用程序。在转到localhost时,我看到subject的错误。事实上,我没有任何挂起的迁移: Status Migration ID Migration Name -------------------------------------------------- up 20150222215652 Create products up 20150405145349 Creat

我正在尝试使用Phusion Passenger运行简单的RoR应用程序。在转到localhost时,我看到subject的错误。事实上,我没有任何挂起的迁移:

     Status   Migration ID    Migration Name
--------------------------------------------------
   up     20150222215652  Create products
   up     20150405145349  Create carts
   up     20150405151313  Create line items
   up     20150407094606  Add quantity to line items
   up     20150409062414  Combine items in cart
   up     20150516084832  Create orders
   up     20150516084958  Add order id to line item
   up     20151005170430  Add ship date to orders
   up     20151011083822  Create users
   up     20151118212158  Add locale to products
我的平台是Linux(Debian8Jessie64x)

我的数据库是MySQL(gem'mysql2','~>0.3.18')

我使用的是Ruby 2.2.1p85(2015-02-26修订版49769)[x86_64-linux]和Rails 4.1.8

乘客版为5.0.22


有人知道如何解决这个问题吗?我错过了什么?

我的问题终于解决了。帮助琐碎的Apache服务器重新启动。我知道Rails能够动态应用大多数更改,所以我甚至不认为需要在某个时候重新启动Apache。我只是在修改了它的配置之后才这么做的。无论如何,感谢所有试图帮助我的人。

也许有一天会有任何迁移现在被删除,因此schema.rb中的版本与上次迁移的版本不匹配,这就是Rails认为存在挂起迁移的原因。您可以运行
rake db:drop;rake-db:创建;rake db:migrate
。它将从中重新创建dbscratch@hedgesky只有当我通过配置了Passenger的Apache访问应用程序时,才会发生此错误。我可以执行命令
rails s
,应用程序可以通过
localhost:3000
访问,没有任何问题。@mef\uu我试图手动删除与应用程序相关的所有MySQL架构,然后运行
rake db:create
rake db:migrate
。没有改变。当你运行这些命令时,输出是什么?太简单了。Rails没有在文件更改时初始化整个堆栈。@iltempo
ActiveRecord::PendingMigrationError
是由
check\u pending>引发的migration.rb
脚本中的code>方法。所以我决定注释掉那个方法的主体,然后点击浏览器中的刷新按钮。令我惊讶的是,一切都没有改变。我重新启动了Apache,错误消失了。目前,
migration.rb
中的更改被恢复,Apache被重新启动了好几次<代码>ActiveRecord::PendingMigrationError
未显示。