Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/grails/5.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
Ruby 执行rake db时出错:在Heroku上迁移_Ruby_Heroku_Rake_Database Migration - Fatal编程技术网

Ruby 执行rake db时出错:在Heroku上迁移

Ruby 执行rake db时出错:在Heroku上迁移,ruby,heroku,rake,database-migration,Ruby,Heroku,Rake,Database Migration,当做 heroku运行rake数据库:迁移 所有迁移都已执行,最后我总是收到以下消息: /app/vendor/bundle/ruby/1.9.1/bin/rake:没有这样的文件或目录-pg_dump-i-s-x-O-f/app/db/structure.sql dan79p98fykovu 我无法将pg_转储添加到Heroku上的路径。 如何处理这个问题?问题是rails试图在迁移完成后转储一个新的结构。sql,但由于不存在pgu dump而失败。为已部署的应用程序生成新的structure

当做

heroku运行rake数据库:迁移

所有迁移都已执行,最后我总是收到以下消息:

/app/vendor/bundle/ruby/1.9.1/bin/rake:没有这样的文件或目录-pg_dump-i-s-x-O-f/app/db/structure.sql dan79p98fykovu

我无法将pg_转储添加到Heroku上的路径。
如何处理这个问题?

问题是rails试图在迁移完成后转储一个新的
结构。sql
,但由于不存在
pgu dump
而失败。为已部署的应用程序生成新的structure.sql是毫无意义的,因此最好的解决方案是告诉rails不要这样做

编辑您的
Rakefile
并覆盖该任务。在末尾添加以下行应该可以:

Rake::Task["db:structure:dump"].clear if Rails.env.production?

你的档案里有什么?可能是您有一个gem,它在依赖于pgu转储的迁移之后试图执行一些代码。以前,每次运行rake任务后,我都会收到一条错误消息,这与我使用RSpec进行测试时安装的Test::Unit有关——有点类似的问题看看这个问题:可能是您使用的Rails版本存在此错误/问题——您使用的是什么版本?注意:只有当除非Rails.env.development?是一个更好的条件,否则使用structure.sql而不是schema.rb不会
?为什么不存在
pgu dump
?生产应用程序不需要它。