Check which ENV variable should contain redis configuration
For example, if you intend to use Redis for Sidekiq, you need to map ENV ["REDISTOGO_URL"] to ENV ["REDIS_PROVIDER"] because Sidekiq expects to receive a redis configuration from ENV ["REDIS_PROVIDER"]
You can do it this way
heroku config:set REDIS_PROVIDER=REDISTOGO_URL
Also you do not need URI.parse , Redis will do it instead of you if necessary.
$redis = Redis.new(url: ENV['REDISTOGO_URL' || "redis://localhost:6379/"])
I suggest using gem figaro to set ENV variables for your local development. This way you delete the OR statement
$redis = Redis.new(url: ENV['REDISTOGO_URL'])
and set an alternate value in config / application.yml
REDISTOGO_URL: redis:
source share