Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Resque无法连接heroku上的postgis适配器_Ruby On Rails_Postgresql_Heroku_Postgis - Fatal编程技术网

Ruby on rails Resque无法连接heroku上的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|

我在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|
    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]无法从客户端接收数据:对等方重置连接

在连接到数据库时,它基本上崩溃了

我的问题是我怎样才能让它工作