I am using redis as a read cache. I have created an initializer
config/initializer/redis.rb
$redis = Redis.new(:host => ENV[\"REDIS_HOST\"], :port =&
According to this Heroku, you don't need to add $redis
to your Unicorn:
No special setup is required when using Redis Cloud with a Unicorn server. Users running Rails apps on Unicorn should follow the instructions in the Configuring Redis from Rails section and users...
Here's all the "Configuring Redis from Rails section" has for before Rails 4 (besides the Gemfile and some other pre-Rails 3 stuff):
# config/initalizers/redis.rb
if ENV["REDISCLOUD_URL"]
uri = URI.parse(ENV["REDISCLOUD_URL"])
$redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
end
It doesn't really give an explanation as to why "no special setup is required".