I want to use redis with sinatra,and followed the guide like this
require "redis"
redis = Redis.new
then, I got the error
LoadError: no such file to load -- redis
maybe the lib of redis is not loading.
I git the redis-rb from github and copy the lib of redis into my sinatra app.
How can I install the redis-rb? I google something like that:
rake redis:install
Have you included redis in your “Gemfile”? It should be in your application root.
Why? It is more convenient to install redis via bundler. (Redis is available as a Ruby gem).
I’m sure you can find proper introductions to bunler via your favourite search engine, but let me show you an example “Gemfile” to use with bundler anyway:
When you run bundler, redis should be ready to go with your configuration.