views:

388

answers:

2

Hello, when trying to run:

rake db:create

I get the following error:

undefined method `quote_ident' for PGconn:Class

Having googled for a solution, it seems by adding:

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

to config/initializers/new_rails_defaults.rb should solve the problem, but I'm still getting the error! Any suggestions? Thank you

See error here: http://github.com/mneumann/postgres-pr/issues/issue/1

A: 

I would think this is a version mismatch.

Are you sure you have the right versions of everything installed? E.g. Postgres server, libpgsql (Postgres client library), whatever library Ruby has for accessing Postgres, and finally your application (rake)?

Bandi-T
No, I'm not sure. How do I find out if I have the "right" versions?See here: http://github.com/mneumann/postgres-pr/issues/issue/1
RewbieNewbie
The Generic approach is going through the documentation of whatever is on top of the stack, and look for required versions of things below it. Then go through the documentation of each of those required things, and look for what version of things those require, etc.So in your case, you would go through the documentation of rake and look for what version of Ruby, Ruby-Postgres module (I'm not sure of the name of that as I'm not a Ruby person), what version of Postgres, etc. it requires, and then check whether you have the correct version of those. And if needed, keep digging deeper.
Bandi-T
Oh, so this is a known problem in the software! I see. Well then I'm sorry, can't help, I don't know Ruby well enough.
Bandi-T
NP, thanks Brandi :)
RewbieNewbie
+1  A: 

The solution is to add:

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

to active_record/connection_adapters/postgresql_adapter.rb

RewbieNewbie