mirror of https://github.com/rails/rails
PostgreSQL: Allow pg-1.0 gem to be used with ActiveRecord
pg-1.0.0 is just released and most Gemfiles don't restrict
it's version. But the version is checked when connecting to
the database, which leads to the following error:
Gem::LoadError: can't activate pg (~> 0.18), already activated pg-1.0.0
See also this pg issue:
https://bitbucket.org/ged/ruby-pg/issues/270/pg-100-x64-mingw32-rails-server-not-start
Preparation for pg-1.0 was done in commit f28a331023
,
but the pg version constraint was not yet relaxed.
This commit is contained in:
parent
96f5930610
commit
f820dc2dea
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
gem "pg", "~> 0.18"
|
||||
gem "pg", ">= 0.18", "< 2.0"
|
||||
require "pg"
|
||||
require "thread"
|
||||
require "digest/sha1"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Make sure we're using pg high enough for type casts and Ruby 2.2+ compatibility
|
||||
gem "pg", "~> 0.18"
|
||||
gem "pg", ">= 0.18", "< 2.0"
|
||||
require "pg"
|
||||
|
||||
require "active_record/connection_adapters/abstract_adapter"
|
||||
|
|
|
@ -301,7 +301,7 @@ module Rails
|
|||
# %w( mysql postgresql sqlite3 oracle frontbase ibm_db sqlserver jdbcmysql jdbcsqlite3 jdbcpostgresql )
|
||||
case options[:database]
|
||||
when "mysql" then ["mysql2", ["~> 0.4.4"]]
|
||||
when "postgresql" then ["pg", ["~> 0.18"]]
|
||||
when "postgresql" then ["pg", [">= 0.18", "< 2.0"]]
|
||||
when "oracle" then ["activerecord-oracle_enhanced-adapter", nil]
|
||||
when "frontbase" then ["ruby-frontbase", nil]
|
||||
when "sqlserver" then ["activerecord-sqlserver-adapter", nil]
|
||||
|
|
|
@ -413,7 +413,7 @@ class AppGeneratorTest < Rails::Generators::TestCase
|
|||
if defined?(JRUBY_VERSION)
|
||||
assert_gem "activerecord-jdbcpostgresql-adapter"
|
||||
else
|
||||
assert_gem "pg", "'~> 0.18'"
|
||||
assert_gem "pg", "'>= 0.18', '< 2.0'"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue