title: How to use Redis with Rails?
body: <p>I want really fast caching and hence I am using redis. I think I am doing it wrong and hence am facing issues. </p>
  
  <p>Here is what I am doing everytime I used redis. In my controller file, 
  user.rb</p>
  
  <pre><code>def online?
    !Redis.new.get("#{self.auth_token}").nil?
  end
  </code></pre>
  
  <p>Then for checking if users are online or not, I am using this, </p>
  
  <pre><code>@users_ol = User.where(:id =&gt; @id).select(&amp;:online?)
  </code></pre>
  
  <p>This fetches me list of all the users currently online. This works well in localhost but breaks when running on server. </p>
  
  <p>My questions are </p>
  
  <ul>
  <li>How to debug and know if this problem is being caused by redis or not?</li>
  <li>What is the proper way to use Redis in Rails? </li>
  <li>Does redis need extra confguration for server (nginx) to work properly in production?</li>
  </ul>
  
  <p>You can comment with the link answering theses questions (fine with me) 
  Thanks in advance</p>