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?