Check which ENV variable should contain redis configuration
For example if you are going to use Redis for Sidekiq you need to map ENV["REDISTOGO_URL"] to ENV["REDIS_PROVIDER"]
because Sidekiq is expecting to get redis configuration from ENV["REDIS_PROVIDER"]
You can do it this way
heroku config:set REDIS_PROVIDER=REDISTOGO_URL
Also you don't need to URI.parse, Redis will do it instead of you in case it is needed.
$redis = Redis.new(url: ENV['REDISTOGO_URL' || "redis://localhost:6379/"])
I suggest to use the gem figaro to set ENV variables for your local development. Thus you remove OR statement
$redis = Redis.new(url: ENV['REDISTOGO_URL'])
and set alternative value in your config/application.yml
REDISTOGO_URL: redis://127.0.0.1:6379