aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorLars Kanis <lars@greiz-reinsdorf.de>2018-01-10 20:40:08 +0100
committerLars Kanis <lars@greiz-reinsdorf.de>2018-01-10 21:55:43 +0100
commitf820dc2dea3775f6c05c5ca77631ac27a9d3c954 (patch)
treeeeb4b4fd66b8a489ffe7a1afbedf9c285e651337 /railties
parent96f59306101a6ee252df2a9636ef2569d26924f7 (diff)
downloadrails-f820dc2dea3775f6c05c5ca77631ac27a9d3c954.tar.gz
rails-f820dc2dea3775f6c05c5ca77631ac27a9d3c954.tar.bz2
rails-f820dc2dea3775f6c05c5ca77631ac27a9d3c954.zip
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 f28a331023fab, but the pg version constraint was not yet relaxed.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/app_base.rb2
-rw-r--r--railties/test/generators/app_generator_test.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb
index e18aeda0d0..e152a95fd3 100644
--- a/railties/lib/rails/generators/app_base.rb
+++ b/railties/lib/rails/generators/app_base.rb
@@ -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]
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 3f01da42fb..60b9ff1317 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -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