quatermain
quatermain

Reputation: 1452

Rails can not connect to redis on openshift

I have openshift apps with installation of redis from this example I have these settings for Sidekiq(initializers/sidekiq.rb):

Sidekiq.configure_server do |config|
  config.redis = { path: "#{ENV['OPENSHIFT_GEAR_DIR']}tmp/redis.sock" }
end

Sidekiq.configure_client do |config|
  config.redis = { path: "#{ENV['OPENSHIFT_GEAR_DIR']}tmp/redis.sock" }
end

But I have this error If I can use sidekiq:

Redis::CannotConnectError (Error connecting to Redis on localhost:6379 (ECONNREFUSED)):

any suggestions?

Upvotes: 1

Views: 1702

Answers (1)

banzaiman
banzaiman

Reputation: 2663

The error message says that Sidekiq is trying to connect to port 6379 on localhost. The OpenShift example you are using sets the port to 0 in the configuration file, so that the server will not listen on any TCP socket.

I think this answers your question: https://github.com/mperham/sidekiq/issues/228#issuecomment-7618003

Upvotes: 1

Related Questions