Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

Rails: redis connection string with password throws EADDRNOTAVAIL

$
0
0

In my environment file, I have:

config.cache_store = :redis_cache_store, { url: ENV.fetch('REDIS_URL_CACHING', 'redis://localhost:6379/0')}

In rails console, if I print REDIS_URL_CACHING, I get:

> ENV['REDIS_URL_CACHING']=> "redis://:mypassword@localhost:6379/0

However, if I want to check if rails is connected to redis, I get:

> Rails.cache.redis.keys=> falseirb(main):004:0> Rails.cache.redis.keysTraceback (most recent call last):        1: from (irb):4Redis::CannotConnectError (Error connecting to Redis on localhost:6379 (Errno::EADDRNOTAVAIL))

My redis.conf file is like:

bind 0.0.0.0requirepass mypassword

What am I missing here?


Viewing all articles
Browse latest Browse all 873

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>