私はsidekiq/redisをかなり長い間使用しており、これまで問題はありませんでした。
何らかの理由で、今日私はこのエラーが発生しています:
Redis::CannotConnectError - Error connecting to Redis on 127.0.0.1:6379 (ECONNREFUSED):
そのため、Redisは、herokuのredis_to_go URLではなく、ローカルホスト接続に接続しようとしています。
私のredis.rbファイルは次のようになります:
uri = URI.parse(ENV["REDISTOGO_URL"] || "redis://localhost:6379/")
REDIS = Redis.new(:Host => uri.Host, :port => uri.port, :password => uri.password)
そして、heroku config
と入力すると、次のように表示されます。
REDISTOGO_URL: redis://redistogo:[email protected]:10280/
これは、HerokuのRedis ToGoアドオンに表示されているURLに正確にマップされます。
昨日機能したときと機能しなかったときの間で私が知っているRedisで何も変わりませんでしたが、MongoHQを使用してMongoDBを起動しました。おそらくどこかに対立がありますか?
どんな助けでも大歓迎です。
Mongo initファイルがなく、作成したmongo固有のファイルはconfig/mongoid.yml
ファイルだけでした。次のようになります。
development:
sessions:
default:
database: mongoid_dev
hosts:
- localhost:27017
options: #strictly 2 spaces before
raise_not_found_error: false #strictly 4 spaces before not 6
production:
sessions:
default:
uri: <%= ENV['MONGOHQ_URL'] %>
options: #strictly 2 spaces before
raise_not_found_error: false #strictly 4 spaces before not 6
マスターからMongoをインストールし、Rails 4.1.0を実行しています。
完全なトレースエラーは以下のとおりです。
2014-04-15T20:33:05.068810+00:00 app[web.1]: Redis::CannotConnectError - Error connecting to Redis on 127.0.0.1:6379 (ECONNREFUSED):
2014-04-15T20:33:05.068810+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:290:in `rescue in establish_connection'
2014-04-15T20:33:05.068810+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:285:in `establish_connection'
2014-04-15T20:33:05.068810+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:79:in `block in connect'
2014-04-15T20:33:05.068810+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:257:in `with_reconnect'
2014-04-15T20:33:05.068810+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:78:in `connect'
2014-04-15T20:33:05.068810+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:304:in `ensure_connected'
2014-04-15T20:33:05.068810+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:191:in `block in process'
2014-04-15T20:33:05.068810+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:270:in `logging'
2014-04-15T20:33:05.068810+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:190:in `process'
2014-04-15T20:33:05.069016+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:96:in `call'
2014-04-15T20:33:05.069016+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/redis-3.0.7/lib/redis.rb:186:in `block in info'
2014-04-15T20:33:05.069016+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/redis-3.0.7/lib/redis.rb:37:in `block in synchronize'
2014-04-15T20:33:05.069016+00:00 app[web.1]: /app/vendor/Ruby-2.0.0/lib/Ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
2014-04-15T20:33:05.069016+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/redis-3.0.7/lib/redis.rb:37:in `synchronize'
2014-04-15T20:33:05.069016+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/redis-3.0.7/lib/redis.rb:185:in `info'
2014-04-15T20:33:05.069016+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sidekiq-3.0.0/lib/sidekiq/web.rb:218:in `block (2 levels) in <class:Web>'
2014-04-15T20:33:05.069016+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/connection_pool-2.0.0/lib/connection_pool.rb:58:in `with'
2014-04-15T20:33:05.069016+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sidekiq-3.0.0/lib/sidekiq.rb:69:in `redis'
2014-04-15T20:33:05.069016+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sidekiq-3.0.0/lib/sidekiq/web.rb:218:in `block in <class:Web>'
2014-04-15T20:33:05.069244+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call'
2014-04-15T20:33:05.069244+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `block in compile!'
2014-04-15T20:33:05.069244+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `[]'
2014-04-15T20:33:05.069244+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (3 levels) in route!'
2014-04-15T20:33:05.069244+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:985:in `route_eval'
2014-04-15T20:33:05.069244+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/instrumentation/sinatra.rb:133:in `route_eval_with_newrelic'
2014-04-15T20:33:05.069244+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (2 levels) in route!'
2014-04-15T20:33:05.069244+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1006:in `block in process_route'
2014-04-15T20:33:05.069244+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `catch'
2014-04-15T20:33:05.069244+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `process_route'
2014-04-15T20:33:05.069903+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/instrumentation/sinatra.rb:116:in `process_route_with_newrelic'
2014-04-15T20:33:05.069903+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:964:in `block in route!'
2014-04-15T20:33:05.069903+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `each'
2014-04-15T20:33:05.069903+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `route!'
2014-04-15T20:33:05.069903+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1076:in `block in dispatch!'
2014-04-15T20:33:05.069903+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
2014-04-15T20:33:05.069903+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
2014-04-15T20:33:05.069903+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
2014-04-15T20:33:05.069903+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1073:in `dispatch!'
2014-04-15T20:33:05.069903+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/instrumentation/sinatra.rb:151:in `dispatch_and_notice_errors_with_newrelic'
2014-04-15T20:33:05.070192+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/instrumentation/sinatra.rb:146:in `block in dispatch_with_newrelic'
2014-04-15T20:33:05.070192+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:335:in `perform_action_with_newrelic_trace'
2014-04-15T20:33:05.070192+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/instrumentation/sinatra.rb:143:in `dispatch_with_newrelic'
2014-04-15T20:33:05.070192+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `block in call!'
2014-04-15T20:33:05.070192+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
2014-04-15T20:33:05.070192+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
2014-04-15T20:33:05.070192+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
2014-04-15T20:33:05.070192+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `call!'
2014-04-15T20:33:05.070192+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:886:in `call'
2014-04-15T20:33:05.070192+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/rack/error_collector.rb:55:in `call'
2014-04-15T20:33:05.070654+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/rack/browser_monitoring.rb:27:in `call'
2014-04-15T20:33:05.070654+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/rack/agent_hooks.rb:32:in `call'
2014-04-15T20:33:05.070654+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
2014-04-15T20:33:05.070654+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
2014-04-15T20:33:05.070654+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
2014-04-15T20:33:05.070654+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
2014-04-15T20:33:05.070654+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
2014-04-15T20:33:05.070654+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
2014-04-15T20:33:05.070654+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'
2014-04-15T20:33:05.070654+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
2014-04-15T20:33:05.070976+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:180:in `call'
2014-04-15T20:33:05.070976+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:2014:in `call'
2014-04-15T20:33:05.070976+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `block in call'
2014-04-15T20:33:05.070976+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1788:in `synchronize'
2014-04-15T20:33:05.070976+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `call'
2014-04-15T20:33:05.070976+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/actionpack-4.1.0/lib/action_dispatch/journey/router.rb:71:in `block in call'
2014-04-15T20:33:05.070976+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/actionpack-4.1.0/lib/action_dispatch/journey/router.rb:59:in `each'
2014-04-15T20:33:05.070976+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/actionpack-4.1.0/lib/action_dispatch/journey/router.rb:59:in `call'
2014-04-15T20:33:05.070976+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/actionpack-4.1.0/lib/action_dispatch/routing/route_set.rb:676:in `call'
2014-04-15T20:33:05.070976+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/rack/error_collector.rb:55:in `call'
2014-04-15T20:33:05.071462+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/rack/agent_hooks.rb:32:in `call'
2014-04-15T20:33:05.071462+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/rack/browser_monitoring.rb:27:in `call'
2014-04-15T20:33:05.071462+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
2014-04-15T20:33:05.071462+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
2014-04-15T20:33:05.071462+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
2014-04-15T20:33:05.071462+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
2014-04-15T20:33:05.071462+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:25:in `call'
2014-04-15T20:33:05.071462+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
2014-04-15T20:33:05.071462+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/actionpack-4.1.0/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
2014-04-15T20:33:05.071462+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/actionpack-4.1.0/lib/action_dispatch/middleware/flash.rb:254:in `call'
2014-04-15T20:33:05.071665+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
2014-04-15T20:33:05.071665+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
2014-04-15T20:33:05.071665+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/actionpack-4.1.0/lib/action_dispatch/middleware/cookies.rb:560:in `call'
2014-04-15T20:33:05.071665+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/activerecord-4.1.0/lib/active_record/query_cache.rb:36:in `call'
2014-04-15T20:33:05.071665+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
2014-04-15T20:33:05.071665+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/actionpack-4.1.0/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
2014-04-15T20:33:05.071665+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/activesupport-4.1.0/lib/active_support/callbacks.rb:82:in `run_callbacks'
2014-04-15T20:33:05.071665+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/actionpack-4.1.0/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2014-04-15T20:33:05.071665+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/actionpack-4.1.0/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
2014-04-15T20:33:05.071665+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/actionpack-4.1.0/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
2014-04-15T20:33:05.072148+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/actionpack-4.1.0/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2014-04-15T20:33:05.072148+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/railties-4.1.0/lib/Rails/rack/logger.rb:38:in `call_app'
2014-04-15T20:33:05.072148+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/railties-4.1.0/lib/Rails/rack/logger.rb:20:in `block in call'
2014-04-15T20:33:05.072148+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/activesupport-4.1.0/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2014-04-15T20:33:05.072148+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/activesupport-4.1.0/lib/active_support/tagged_logging.rb:26:in `tagged'
2014-04-15T20:33:05.072148+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/activesupport-4.1.0/lib/active_support/tagged_logging.rb:68:in `tagged'
2014-04-15T20:33:05.072148+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/railties-4.1.0/lib/Rails/rack/logger.rb:20:in `call'
2014-04-15T20:33:05.072148+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/actionpack-4.1.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-04-15T20:33:05.072148+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-04-15T20:33:05.072148+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-04-15T20:33:05.072577+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/activesupport-4.1.0/lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
2014-04-15T20:33:05.072577+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/actionpack-4.1.0/lib/action_dispatch/middleware/static.rb:64:in `call'
2014-04-15T20:33:05.072577+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
2014-04-15T20:33:05.072577+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/railties-4.1.0/lib/Rails/engine.rb:514:in `call'
2014-04-15T20:33:05.072577+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/railties-4.1.0/lib/Rails/application.rb:144:in `call'
2014-04-15T20:33:05.072577+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/Unicorn-4.8.2/lib/Unicorn/http_server.rb:572:in `process_client'
2014-04-15T20:33:05.072577+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/Unicorn-4.8.2/lib/Unicorn/http_server.rb:666:in `worker_loop'
2014-04-15T20:33:05.072577+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/instrumentation/Unicorn_instrumentation.rb:22:in `call'
2014-04-15T20:33:05.072577+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/instrumentation/Unicorn_instrumentation.rb:22:in `block (4 levels) in <top (required)>'
2014-04-15T20:33:05.072577+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/Unicorn-4.8.2/lib/Unicorn/http_server.rb:521:in `spawn_missing_workers'
2014-04-15T20:33:05.073631+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/Unicorn-4.8.2/lib/Unicorn/http_server.rb:140:in `start'
2014-04-15T20:33:05.073631+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/gems/Unicorn-4.8.2/bin/Unicorn:126:in `<top (required)>'
2014-04-15T20:33:05.073631+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/bin/Unicorn:23:in `load'
2014-04-15T20:33:05.073631+00:00 app[web.1]: /app/vendor/bundle/Ruby/2.0.0/bin/Unicorn:23:in `<main>'
問題はENV変数にあります:
Sidekiqのドキュメントによると:
RedisToGoは、Sidekiq2.x以前のデフォルトのREDISTOGO_URLenv変数で使用できます(REDISTOGO_URLはレガシーの理由でサポートされており、REDIS_PROVIDERおよびREDIS_URL変数が推奨されます)。
Sidekiq 3以降では、REDIS_PROVIDER
の代わりにREDIS_URL
またはREDISTOGO_URL
ENV変数を使用する必要があります。 sidekiq初期化子は必要ありません。このコードでうまくいきます。
ターミナルから以下を実行します
heroku config:set REDIS_PROVIDER=redis://...........
私も同じ問題を抱えていました。 Sidekiq 3+は、REDISTOGO_URL環境変数を自動的に認識しません。代わりに、REDIS_PROVIDERが使用されます。私は次の方法で構成参照を行いました:
heroku config:set REDIS_PROVIDER=REDISTOGO_URL
その後、問題は解決しました
私の ブログ投稿 で詳細な説明をします
redis.rbファイルを次のように設定します。
module MyApp
class << self
def redis
@redis ||= Redis.new(url: (ENV['REDISTOGO_URL'] || 'redis://127.0.0.1:6379'))
end
end
end
あなたのsidekiq.rbで行います:
Sidekiq.configure_server do |config|
Rails.logger = Sidekiq::Logging.logger
config.redis = { :url => MyApp.redis[:url], :namespace => 'sidekiq', :size => 5 }
end
Sidekiq.configure_client do |config|
config.redis = { :url => MyApp.redis[:url], :namespace => 'sidekiq', :size => 1 }
end
これにより、Sidekiqがredis.rbinitファイルからRedis接続を確実に取得します。