无法创建数据库,未定义的方法`quote_ident'?

时间:2010-01-23 17:57:13

标签: ruby-on-rails

rake db:create

我收到以下错误:

undefined method `quote_ident' for PGconn:Class

通过搜索解决方案,似乎添加了:

def PGconn.quote_ident(name)
%("#{name}")
end

config / initializers / new_rails_defaults.rb应该可以解决问题,但我仍然收到错误!有什么建议?谢谢

请在此处查看错误:http://github.com/mneumann/postgres-pr/issues/issue/1

2 个答案:

答案 0 :(得分:3)

解决方案是添加:

def PGconn.quote_ident(name)
%("#{name}")
end

到active_record / connection_adapters / postgresql_adapter.rb

答案 1 :(得分:0)

我认为这是版本不匹配。

您确定安装了所有版本的正确版本吗?例如。 Postgres服务器,libpgsql(Postgres客户端库),Ruby用于访问Postgres的库,最后是你的应用程序(rake)?