Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CF-22 fix: rails app using latest pg gem fails to deploy to CF

Change-Id: If6e94b99fa77aea5973cb606585d2a8c634f5b1b
  • Loading branch information...
commit 3ba209c6ad99eb31dce7c47b4ea760535e5c23e3 1 parent 1b566bc
@oppegard oppegard authored
View
2  auto-reconfiguration/Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- cf-autoconfig (0.0.3)
+ cf-autoconfig (0.0.4)
cf-runtime (= 0.0.1)
GEM
View
5 auto-reconfiguration/lib/cfautoconfig/document/mongodb_configurer.rb
@@ -3,7 +3,8 @@
#Require mongo here is mandatory for configurer to ensure class is loaded before applying OpenClass
require "mongo"
require File.join(File.dirname(__FILE__), 'mongodb')
- if Gem::Version.new(Mongo::VERSION) >= Gem::Version.new(AutoReconfiguration::SUPPORTED_MONGO_VERSION)
+ mongo_version = Gem.loaded_specs['mongo'].version
+ if mongo_version >= Gem::Version.new(AutoReconfiguration::SUPPORTED_MONGO_VERSION)
if AutoReconfiguration::ConfigurationHelper.disabled? :mongodb
puts "MongoDB auto-reconfiguration disabled."
module Mongo
@@ -35,7 +36,7 @@ class Connection
end
else
puts "Auto-reconfiguration not supported for this Mongo version. " +
- "Found: #{Mongo::VERSION}. Required: #{AutoReconfiguration::SUPPORTED_MONGO_VERSION} or higher."
+ "Found: #{mongo_version}. Required: #{AutoReconfiguration::SUPPORTED_MONGO_VERSION} or higher."
end
rescue LoadError
puts "No MongoDB Library Found. Skipping auto-reconfiguration."
View
5 auto-reconfiguration/lib/cfautoconfig/keyvalue/redis_configurer.rb
@@ -2,7 +2,8 @@
begin
require 'redis'
require File.join(File.dirname(__FILE__), 'redis')
- if Gem::Version.new(Redis::VERSION) >= Gem::Version.new(AutoReconfiguration::SUPPORTED_REDIS_VERSION)
+ redis_version = Gem.loaded_specs['redis'].version
+ if redis_version >= Gem::Version.new(AutoReconfiguration::SUPPORTED_REDIS_VERSION)
if AutoReconfiguration::ConfigurationHelper.disabled? :redis
puts "Redis auto-reconfiguration disabled."
class Redis
@@ -25,7 +26,7 @@ class Redis
end
else
puts "Auto-reconfiguration not supported for this Redis version. " +
- "Found: #{Redis::VERSION}. Required: #{AutoReconfiguration::SUPPORTED_REDIS_VERSION} or higher."
+ "Found: #{redis_version}. Required: #{AutoReconfiguration::SUPPORTED_REDIS_VERSION} or higher."
end
rescue LoadError
puts "No Redis Library Found. Skipping auto-reconfiguration."
View
5 auto-reconfiguration/lib/cfautoconfig/messaging/amqp_configurer.rb
@@ -3,7 +3,8 @@
#Require amqp here is mandatory for configurer to ensure class is loaded before applying OpenClass
require "amqp"
require File.join(File.dirname(__FILE__), 'amqp')
- if Gem::Version.new(AMQP::VERSION) >= Gem::Version.new(AutoReconfiguration::SUPPORTED_AMQP_VERSION)
+ amqp_version = Gem.loaded_specs['amqp'].version
+ if amqp_version >= Gem::Version.new(AutoReconfiguration::SUPPORTED_AMQP_VERSION)
if AutoReconfiguration::ConfigurationHelper.disabled? :rabbitmq
puts "RabbitMQ auto-reconfiguration disabled."
class << AMQP
@@ -25,7 +26,7 @@ class << AMQP
end
else
puts "Auto-reconfiguration not supported for this AMQP version. " +
- "Found: #{AMQP::VERSION}. Required: #{AutoReconfiguration::SUPPORTED_AMQP_VERSION} or higher."
+ "Found: #{amqp_version}. Required: #{AutoReconfiguration::SUPPORTED_AMQP_VERSION} or higher."
end
rescue LoadError
puts "No AMQP Library Found. Skipping auto-reconfiguration."
View
5 auto-reconfiguration/lib/cfautoconfig/relational/mysql_configurer.rb
@@ -4,7 +4,8 @@
#Require mysql2 here is mandatory for configurer to ensure class is loaded before applying OpenClass
require "mysql2"
require File.join(File.dirname(__FILE__), 'mysql')
- if Gem::Version.new(Mysql2::VERSION) >= Gem::Version.new(AutoReconfiguration::SUPPORTED_MYSQL2_VERSION)
+ mysql2_version = Gem.loaded_specs['mysql2'].version
+ if mysql2_version >= Gem::Version.new(AutoReconfiguration::SUPPORTED_MYSQL2_VERSION)
if AutoReconfiguration::ConfigurationHelper.disabled? :mysql
puts "MySQL auto-reconfiguration disabled."
module Mysql2
@@ -29,7 +30,7 @@ class Client
end
else
puts "Auto-reconfiguration not supported for this Mysql2 version. " +
- "Found: #{Mysql2::VERSION}. Required: #{AutoReconfiguration::SUPPORTED_MYSQL2_VERSION} or higher."
+ "Found: #{mysql2_version}. Required: #{AutoReconfiguration::SUPPORTED_MYSQL2_VERSION} or higher."
end
rescue LoadError
puts "No MySQL Library Found. Skipping auto-reconfiguration."
View
5 auto-reconfiguration/lib/cfautoconfig/relational/postgres_configurer.rb
@@ -3,7 +3,8 @@
#Require pg here is mandatory for configurer to ensure class is loaded before applying OpenClass
require "pg"
require File.join(File.dirname(__FILE__), 'postgres')
- if Gem::Version.new(PGconn::VERSION) >= Gem::Version.new(AutoReconfiguration::SUPPORTED_PG_VERSION)
+ pg_version = Gem.loaded_specs['pg'].version
+ if pg_version >= Gem::Version.new(AutoReconfiguration::SUPPORTED_PG_VERSION)
if AutoReconfiguration::ConfigurationHelper.disabled? :postgresql
puts "PostgreSQL auto-reconfiguration disabled."
class << PGconn
@@ -33,7 +34,7 @@ class << PGconn
end
else
puts "Auto-reconfiguration not supported for this PG version. " +
- "Found: #{PGconn::VERSION}. Required: #{AutoReconfiguration::SUPPORTED_PG_VERSION} or higher."
+ "Found: #{pg_version}. Required: #{AutoReconfiguration::SUPPORTED_PG_VERSION} or higher."
end
rescue LoadError
puts "No PostgreSQL Library Found. Skipping auto-reconfiguration."
View
2  auto-reconfiguration/lib/cfautoconfig/version.rb
@@ -1,3 +1,3 @@
module AutoReconfiguration
- VERSION = '0.0.3'
+ VERSION = '0.0.4'
end
Please sign in to comment.
Something went wrong with that request. Please try again.