Ruby on rails Resque无法连接heroku上的postgis适配器
我在heroku上有一个RubyonRails应用程序。我们用它来做一些postgis的东西。根据,当使用Ruby on rails Resque无法连接heroku上的postgis适配器,ruby-on-rails,postgresql,heroku,postgis,Ruby On Rails,Postgresql,Heroku,Postgis,我在heroku上有一个RubyonRails应用程序。我们用它来做一些postgis的东西。根据,当使用ActiveRecord连接到Postgresql时,我尝试将适配器覆盖到postgis。下面是我的config/initializers/redis.rb if ENV['REDISCLOUD_URL'] $redis = Resque.redis = Redis.new(url: ENV['REDISCLOUD_URL']) Resque.after_fork do |job|
ActiveRecord
连接到Postgresql时,我尝试将适配器覆盖到postgis
。下面是我的config/initializers/redis.rb
if ENV['REDISCLOUD_URL']
$redis = Resque.redis = Redis.new(url: ENV['REDISCLOUD_URL'])
Resque.after_fork do |job|
if defined?(ActiveRecord::Base)
config = ActiveRecord::Base.configurations[Rails.env] ||
Rails.application.config.database_configuration[Rails.env]
config['adapter'] = 'postgis'
ActiveRecord::Base.establish_connection(config)
end
end
end
当我将作业排入队列以重新设置时,日志中会出现以下警告:
2014-10-27T19:24:35Z应用程序[postgres.2387]:[WHITE]无法从客户端接收数据:对等方重置连接
在连接到数据库时,它基本上崩溃了
我的问题是我怎样才能让它工作