Skip to content

Namespaced Rack::Session, Rack::Cache, I18n and cache Redis stores for Ruby web frameworks

License

Notifications You must be signed in to change notification settings

faber/redis-store

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Namespaced Redis stores for Ruby frameworks

Build Status

Installation

Redis, Option 1: Homebrew

MacOS X users should use Homebrew to install Redis:

brew install redis

Redis, Option 2: From Source

Download and install Redis from http://code.google.com/p/redis/

wget http://redis.googlecode.com/files/redis-2.0.0.tar.gz
tar -zxf redis-2.0.0.tar.gz
mv redis-2.0.0 redis
cd redis
make

Install the Gem

Assuming you're using RVM or on Windows, install the gem with:

gem install redis-store

Options

You can specify the Redis configuration details using a URI or a hash. By default the gem will attempt to connect to localhost port 6379 and the db 0.

Set by URI

For example

"redis://:secret@192.168.1.100:23682/13/theplaylist"

Made up of the following:

host: 192.168.1.100
port: 23682
db: 13
namespace: theplaylist
password: secret

If you want to specify the namespace option, you have to pass the db param too.

Important: namespace is only supported for single, non-distributed stores.

Set by Hash

{ :host => 192.168.1.100, :port => 23682, :db => 13, :namespace => "theplaylist", :password => "secret" }

Important: namespace is only supported for single, non-distributed stores.

Unicorn

Use Rails.cache.reconnect in your Unicorn hooks, in order to force the client reconnection.

Running tests

TODO

If you are on Snow Leopard you have to run env ARCHFLAGS="-arch x86_64" bundle install

Copyright

(c) 2009 - 2011 Luca Guidi - http://lucaguidi.com, released under the MIT license

About

Namespaced Rack::Session, Rack::Cache, I18n and cache Redis stores for Ruby web frameworks

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%