title: Heroku "We're sorry, but something went wrong." due to javascript_include_tag
body: <p>Uploading my ruby on rails app to heroku causes the following error:</p>
  
  <blockquote>
    <p>We're sorry, but something went wrong.</p>
  </blockquote>
  
  <p>This does not occur on my local machine.</p>
  
  <p>After some debugging, I think I may have spotted the error, but do not know how to fix it. </p>
  
  <p>In my file application.html.erb, removing the following line solves the problem, but then my app loses its jquery mobile theme. Any ideas what I could do to fix the problem?</p>
  
  <p><strong>Line causing the problem:</strong></p>
  
  <pre><code>&lt;%= javascript_include_tag "application" %&gt;
  </code></pre>
  
  <p><strong>application.html.erb file:</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Washapp&lt;/title&gt;
    &lt;meta name="viewport" content="width=device-width"&gt;
    &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" /&gt;
    &lt;%= javascript_include_tag "application" %&gt;
  
    &lt;script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"&gt;&lt;/script&gt;
    &lt;%= csrf_meta_tags %&gt;
  
    &lt;script&gt;
      if (window.location.hash == "#_=_")
          window.location.hash = "";
    &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div data-role="page"&gt;
      &lt;%= yield %&gt;
    &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Heroku logs:</strong></p>
  
  <pre><code>2012-04-08T23:28:41+00:00 heroku[nginx]: 78.105.51.57 - - [08/Apr/2012:23:28:41 +0000] "GET / HTTP/1.1" 500 643 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.151 Safari/535.19" washappdelete2.heroku.com
  2012-04-08T23:28:43+00:00 app[web.1]: 
  2012-04-08T23:28:43+00:00 app[web.1]: Started GET "/" for 78.105.51.57 at 2012-04-08 16:28:43 -0700
  2012-04-08T23:28:43+00:00 app[web.1]: 
  2012-04-08T23:28:43+00:00 app[web.1]: Processing by HomeController#index as HTML
  2012-04-08T23:28:43+00:00 app[web.1]:   Rendered home/routa_list.html.erb within layouts/application (0.1ms)
  2012-04-08T23:28:43+00:00 app[web.1]: Completed 500 Internal Server Error in 34ms
  2012-04-08T23:28:43+00:00 app[web.1]: 
  2012-04-08T23:28:43+00:00 app[web.1]:     4:   &lt;title&gt;Washapp&lt;/title&gt;
  2012-04-08T23:28:43+00:00 app[web.1]: ActionView::Template::Error (application.js isn't precompiled):
  2012-04-08T23:28:43+00:00 app[web.1]:     5:   &lt;meta name="viewport" content="width=device-width"&gt;
  2012-04-08T23:28:43+00:00 app[web.1]:     6:   &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" /&gt;
  2012-04-08T23:28:43+00:00 app[web.1]:     7:   &lt;%= javascript_include_tag "application" %&gt;
  2012-04-08T23:28:43+00:00 app[web.1]:     9:   &lt;script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"&gt;&lt;/script&gt;
  2012-04-08T23:28:43+00:00 app[web.1]:     8:   
  2012-04-08T23:28:43+00:00 app[web.1]:     10:   &lt;%= csrf_meta_tags %&gt;
  2012-04-08T23:28:43+00:00 app[web.1]:   app/views/layouts/application.html.erb:7:in `_app_views_layouts_application_html_erb__2373145142857118006_42724320'
  2012-04-08T23:28:43+00:00 app[web.1]:   app/controllers/home_controller.rb:4:in `index'
  2012-04-08T23:28:43+00:00 app[web.1]: cache: [GET /] miss
  2012-04-08T23:28:43+00:00 app[web.1]: 
  2012-04-08T23:28:43+00:00 app[web.1]:
  </code></pre>
  
  <p><strong>app/assets/javascripts/application.js</strong></p>
  
  <pre><code>// This is a manifest file that'll be compiled into application.js, which will include all the files
  // listed below.
  //
  // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
  // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
  //
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
  // the compiled file.
  //
  // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
  // GO AFTER THE REQUIRES BELOW.
  //
  //= require jquery
  //= require jquery_ujs
  //= require_tree .
  </code></pre>
  
  <p><strong>Repository</strong>:
  <a href="https://github.com/karangb/herokuProblem" rel="nofollow">https://github.com/karangb/herokuProblem</a></p>