Skip to content

Instantly share code, notes, and snippets.

@opensourceame
Created April 21, 2020 13:45
Show Gist options
  • Select an option

  • Save opensourceame/b14514fe237b3c125cbcc3e9ff44ab66 to your computer and use it in GitHub Desktop.

Select an option

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
@mrgordon
Copy link
Copy Markdown

Thanks this was still helpful all these years later!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment