“ pg_dump:无效选项-我”迁移时 [英] "pg_dump: invalid option -- i" when migrating

查看:483
本文介绍了“ pg_dump:无效选项-我”迁移时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Rails项目(3.2.22.2)上运行 rake db:migrate 时,我得到 pg_dump:无效的选项-i 。完整的跟踪记录如下:

When I run rake db:migrate on my Rails project (3.2.22.2) I get pg_dump: invalid option -- i. Here's the full trace:

Celluloid 0.17.1.1 is running in BACKPORTED mode. [ http://git.io/vJf3J ]
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
[DEPRECATION] `last_comment` is deprecated.  Please use `last_description` instead.
pg_dump: invalid option -- i
Try "pg_dump --help" for more information.
rake aborted!
Error dumping database
/Users/jasonswett/.rvm/gems/ruby-2.1.4@bm43/gems/activerecord-3.2.22.2/lib/active_record/railties/databases.rake:429:in `block (3 levels) in <top (required)>'
/Users/jasonswett/.rvm/gems/ruby-2.1.4@bm43/gems/activerecord-3.2.22.2/lib/active_record/railties/databases.rake:202:in `block (2 levels) in <top (required)>'
/Users/jasonswett/.rvm/gems/ruby-2.1.4@bm43/gems/activerecord-3.2.22.2/lib/active_record/railties/databases.rake:196:in `block (2 levels) in <top (required)>'
/Users/jasonswett/.rvm/gems/ruby-2.1.4@bm43/bin/ruby_executable_hooks:15:in `eval'
/Users/jasonswett/.rvm/gems/ruby-2.1.4@bm43/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:structure:dump
(See full trace by running task with --trace)

我注意到有一个 Rails中的错误修正与此问题有关。该错误修复程序似乎尚未应用于Rails版本< 4,因为它不是安全修复程序,很有意义。

I notice that there's a bugfix in Rails pertaining to this issue. The bugfix seems not to have been applied to Rails versions < 4 since it's not a security fix, which makes sense.

我不明白的是我现在应该做什么。如果存在针对3.2.x的修复程序,我还无法找到它。我想如果没有针对3.2.x的修复程序,我想那意味着我必须升级到Rails 4.x,这似乎有些过激。我怀疑这真的是唯一的解决方案。为什么最近才突然出现这个问题呢?

What I don't understand is what I'm supposed to do now. If there's a fix for 3.2.x, I haven't been able to find it yet. I guess if there's no fix for 3.2.x, I guess that means I have to upgrade to Rails 4.x, which seems a bit drastic. I doubt that's really the only solution. And why did the issue only recently pop up out of nowhere?

任何建议都会受到赞赏。

Any suggestions are appreciated.

推荐答案

不太可能有修复程序,因为它不是安全问题。即使是这样,我也不确定他们是否正在修补3.x。

Unlikely there is a fix as it's not a security issue. Even if it was, I'm not sure they are patching 3.x anymore.

问题出在这里的db:structure:dump任务中:

The problem is in the db:structure:dump task here:

https://github.com/rails/rails/blob/v3.2.22 .2 / activerecord / lib / active_record / railties / databases.rake#L428

最简单的方法是复制该任务(413-448)并将其放入到您自己的lib / tasks目录中,在其周围包装一个 namespace db ,调整pg_dump命令(删除-i),您的任务应覆盖内置任务。

Easiest thing is to copy that task (413 - 448) and put it into your own lib/tasks directory, wrap a namespace db around it, tweak the pg_dump command (remove -i) and your task should override the built in task.

这篇关于“ pg_dump:无效选项-我”迁移时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆