title: Undefined method `each_with_index' for nil:NilClass
body: <p>I am trying to merge two apps together and add messaging to my program. </p>
  
  <p>However, after following two tutorials I am stuck. I get this error: </p>
  
  <blockquote>
    <p>undefined method `each_with_index' for nil:NilClass on here: </p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>&lt;/div&gt;
    &lt;div class="col-lg-3"&gt;
      &lt;%= render 'shared/links' %&gt;
    &lt;/div&gt;
  &lt;% @users.each_with_index do |index| %&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;%= index +=1 %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= user.name %&gt;&lt;/td&gt;
      &lt;td&gt;
        &lt;%= link_to "Send Message", "#", class: "btn btn-success btn-xs start-conversation",
  ...
  </code></pre>
  
  <p>I am using Rails 5 and Ruby 2.5.0</p>
  
  <p>Here are the two tutorials:</p>
  
  <p><a href="http://josephndungu....n-ruby-on-rails" rel="nofollow noreferrer">http://josephndungu....n-ruby-on-rails</a></p>
  
  <p><a href="https://github.com/scaffeinate/socify" rel="nofollow noreferrer">https://github.com/scaffeinate/socify</a></p>
  
  <p>The social media part works no problem but the chat part doesn't work. </p>