I've trying to use the postgres-pr gem on CentOS/Ruby 1.9.2. When I
attempt to run Webrick (or rake update), I get an error saying that it
cannot find the gem "postgres." I'm not sure why, because nowhere in
my Gemfile or database.yml do I refer to anything called "posgres."
Postgres is confusing (to me). I install "pg (0.10.0)" and that is
working for me. I'm currently toying with Rails 3 using Ruby 1.9.2 but
I've done lots of Ruby 2 using Ruby 1.8 and 1.9.1.
If you use the --database=postgresql option when you create your
project, it will have this at the top:
begin
require_library_or_gem 'pg'
rescue LoadError => e
begin
require_library_or_gem 'postgres'
class PGresult
alias_method :nfields, :num_fields unless
self.method_defined?(:nfields)
alias_method :ntuples, :num_tuples unless
self.method_defined?(:ntuples)
alias_method :ftype, :type unless self.method_defined?(:ftype)
alias_method :cmd_tuples, :cmdtuples unless
self.method_defined?(:cmd_tuples)
end
rescue LoadError
raise e
end
end