title: heroku undefined method empty? when upgrading my app to ruby 2.0
body: <p>I've recently upgraded my Heroku app from Cedar-10 to Cedar-14 with no problems (still using ruby 1.9.3). Then I tried upgrading my app to use ruby 2.0.0-p645 and push it to the heroku server. When I do this I can no longer access my app and I get the following error in the logs;</p>
  
  <pre><code>2015-07-09T12:27:37.480991+00:00 app[web.1]: 
  2015-07-09T12:27:37.480996+00:00 app[web.1]: NoMethodError (undefined method `empty?' for nil:NilClass):
  2015-07-09T12:27:37.480998+00:00 app[web.1]:   app/controllers/wines_controller.rb:18:in `index'
  2015-07-09T12:27:37.480999+00:00 app[web.1]: 
  2015-07-09T12:27:37.481001+00:00 app[web.1]: 
  2015-07-09T12:27:37.481462+00:00 app[web.1]: Processing by WinesController#index as HTML
  2015-07-09T12:27:37.481465+00:00 app[web.1]: Completed 500 Internal Server Error in 100.1ms
  </code></pre>
  
  <p>If I look at line 18 of the wines_controller I have the following;</p>
  
  <pre><code>respond_to do |format|
    format.html
    format.json {render json: @wines.as_json}
  end
  </code></pre>
  
  <p>I thought it was something in my index.html, so I took that back to the this;</p>
  
  <pre><code>%h1 Wines
  </code></pre>
  
  <p>With just this one line in my index.html.haml it still had a problem.</p>
  
  <p>If I try and access wines.json this works and gives me a list of my wines. Running on my development box using 2.0.0 works fine and all my tests pass.</p>
  
  <p>Update: Add controller &amp; more info on index.html</p>
  
  <p>Here is my wines controller</p>
  
  <pre><code>  def index
      # Search via Ransack
      @q = current_user.wines.includes(:wine_rack).unconsumed.order("LOWER(winery)").search(params[:q])
      @wines = @q.result.page params[:page]
      @total = @q.result.sum(:qty)
  
      respond_to do |format|
        format.html
        format.json {render json: @wines.as_json}
      end
    end
  </code></pre>
  
  <p>In regards to my index.html.haml file I uploaded a version of my project which only included this one line;</p>
  
  <pre><code>%h1 Wines
  </code></pre>
  
  <p>There are no loops happening in the view and I still get the error.</p>
  
  <p>Line 18 refers to the following line in my controller;</p>
  
  <pre><code>    respond_to do |format|
  </code></pre>