Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Joe Bruno
Joe Bruno
35,909 Points

Ruby on Rails Heroku Deployment Javascript Compile Issue

Hello,

I have a Ruby on Rails application that I have successfully deployed to Heroku. My issue is that none of my jquery is working AFTER deployment because of conflicts. In development, ruby tags linking back to my app/assets folder pulled in each js file individually.

 <!--CSS StyleSheets-->
   <%= stylesheet_link_tag "application", :media => "all" %>
  <!--Javascript-->
   <%= javascript_include_tag "application" %>

results in

  <script src="/assets/jquery.js?body=1" type="text/javascript"></script>
  <script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script>
  <script src="/assets/home.js?body=1" type="text/javascript"></script>
  <script src="/assets/jfontsize.js?body=1" type="text/javascript"></script>
  <script src="/assets/jquery.externalscript.js?body=1" type="text/javascript"></script>
  <script src="/assets/jquery.feeds.js?body=1" type="text/javascript"></script>
  <script src="/assets/jquery.flexslider.js?body=1" type="text/javascript"></script>

<script src="/assets/jquery.jScrollPane.js?body=1" type="text/javascript"></script> <script src="/assets/jquery.readyselector.js?body=1" type="text/javascript"></script> <script src="/assets/jquery.share.js?body=1" type="text/javascript"></script> <script src="/assets/list.js?body=1" type="text/javascript"></script> <script src="/assets/moment.js?body=1" type="text/javascript"></script> <script src="/assets/pages.js?body=1" type="text/javascript"></script> <script src="/assets/registrations.js?body=1" type="text/javascript"></script> <script src="/assets/responsive-nav.js?body=1" type="text/javascript"></script> <script src="/assets/socialcount.js?body=1" type="text/javascript"></script> <script src="/assets/application.js?body=1" type="text/javascript"></script>

Everything works. However, the production version deployed to Heroku complies all of my js (jquery, custom, and plugins) into one minified application.js file, which results in conflict errors and none of it works! How can I solve this issue?

I have read Heroku's developer info (https://devcenter.heroku.com/articles/rails-asset-pipeline) and Ruby on Rails developer info (http://guides.rubyonrails.org/asset_pipeline.html), but have yet to discover a working solution.

Thanks in advance.

UPDATED:

The issue was caused by a plugin that was no longer in use within my application, but remained in my public/assets folder from an earlier compilation. Removing that file resolved the issue.

1 Answer