Skip to content

Instantly share code, notes, and snippets.

@opensourceame
Created April 21, 2020 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save opensourceame/b14514fe237b3c125cbcc3e9ff44ab66 to your computer and use it in GitHub Desktop.
Save opensourceame/b14514fe237b3c125cbcc3e9ff44ab66 to your computer and use it in GitHub Desktop.
fix to make Rails 4 work with Postgres gem > 0.20.0
# fix to make Rails 4 work with Postgres gem > 0.20.0
#
# place this in your config/application.rb just after the Bundler.require() line
module Kernel
def gem_with_pg_fix(dep, *reqs)
if dep == "pg" && reqs == ["~> 0.15"]
reqs = ["~> 1.0"]
end
gem_without_pg_fix(dep, *reqs)
end
alias_method_chain :gem, :pg_fix
end
PGconn = PG::Connection
PGresult = PG::Result
PGError = PG::Error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment