Redis is a high performance, in-memory key-value data store which can be persisted to disk.
Presuming you have Homebrew installed, you can install the Redis recipe:
There are a few options to install Redis on Ubuntu. The first and easiest is to use
This will set up
redis-server to startup with the OS, but it may be a slightly dated version.
To get the latest stable version you can download from
http://redis.io/download and install using their directions.
There is no official Redis server version for Windows. There is a third-party port of the original service which can be used for development but may not offer 100% compatibility:
Redis-Rails hooks into Rails’s caching layer in order to provide Redis as the backend caching mechanism.
redis-rails by adding
gem 'redis-rails' to the
Gemfile and running
To run experiments in these tutorials, use the following configuration in
1 2 3 4 5
Caching in Development?
If you want to turn on caching in development (while testing / learning about Redis), in the same
1 2 3 4 5 6
The options to configure how
redis-rails connects to Redis are as follows with the default values:
host: IP address or DNS of the host to connect to [default:
port: port Redis is listening on [default:
db: which Redis database to
selectafter connecting [default:
namespace: string to prefix redis keys [default:
password: authentication password for Redis [default:
A hash with the above keys or a string may be specified to connect. The format of the string looks like:
/1/namespace are optional fragments of this string, but note that if you want to specify a namespace the DB number must also be provided.