Skip to content

Instantly share code, notes, and snippets.

@vpamulap
Created February 20, 2012 07:42
Show Gist options
  • Save vpamulap/1868296 to your computer and use it in GitHub Desktop.
Save vpamulap/1868296 to your computer and use it in GitHub Desktop.
config/initializers/recommendable.rb
require "redis"
require "resque"
require "resque-loner"
ENV["REDISTOGO_URL"] ||= "redis://vpamulap:1a987fbf3a3fc0623964631159493a29@chubb.redistogo.com:9220/"
uri = URI.parse(ENV["REDISTOGO_URL"])
# Recommendable requires a connection to a running redis-server. Either create
# a new instance based on a host/port or UNIX socket, or pass in an existing
# Redis client instance.
Recommendable.redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
# Connect to Redis via a UNIX socket instead
# Recommendable.redis = Redis.new(:sock => "")
# Tell Redis which database to use (usually between 0 and 15). The default of 0
# is most likely okay unless you have another application using that database.
# Recommendable.redis.select "0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment