First thing first: Install redis gem and then require it from you ruby code:
require 'redis'
Example 1: Create a new Redis client instance
r = Redis.new
Example 2: List all keys
r.keys
Example 3: Append a value to a list, show ALL the values of the list, pop one value from the left of the list
r.RPUSH("mylist", "myvalue") r.LRANGE("mylist", 0, -1) r.LPOP("mylist")
Example 4: Insert a value from the left of the list, read the value without removing it from the list
r.LPUSH("mylist", "myvalue") r.LINDEX("mylist", 0)