kavinderd
kavinderd

Reputation: 113

Unexpected Character '#' deploying to Heroku

I'm stuck trying to get my app to work on heroku. I can run locally and it works well, but when I deploy to heroku I get the following error:

2012-05-18T21:26:18+00:00 app[web.1]:   (in /app/app/assets/javascripts/application.js.erb)):
2012-05-18T21:26:18+00:00 app[web.1]:     8:   <%= render 'layouts/shim'%>
2012-05-18T21:26:18+00:00 app[web.1]: ActionView::Template::Error (Unexpected character '#'
2012-05-18T21:26:18+00:00 app[web.1]:     4:   <title><%= full_title(yield(:title))%></title>
2012-05-18T21:26:18+00:00 app[web.1]: 
2012-05-18T21:26:18+00:00 app[web.1]:     5:   <%= stylesheet_link_tag    "application", :media => "all" %>
2012-05-18T21:26:18+00:00 app[web.1]:     7:   <%= csrf_meta_tags %>
2012-05-18T21:26:18+00:00 app[web.1]:     3: <head>
2012-05-18T21:26:18+00:00 app[web.1]:     6:   <%= javascript_include_tag "application" %>
2012-05-18T21:26:18+00:00 app[web.1]:   app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb___39687462904242755_48413880'
2012-05-18T21:26:18+00:00 app[web.1]: 
2012-05-18T21:26:18+00:00 app[web.1]: 
 9: </head>

Initially I thought it was a coffeescript problem. But I have since gotten rid of any .coffee files just to see if it will work. Still, the same result

This is my application.js file:

//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require_tree .

$(document).ready(function()
 {  

    function setCountdownTimer(element, year, month, day) {
        var date = new Date(year, month, day);
        $(element).countdown({until: date});
    }


    $('#hashtag_id').live('change', function() {
      $('#user_comments').empty();
      $.ajax({ url: '/headlines/update_comments/',
        data: {hashtag: this.value, id: $('#headline_tag').data('id')},
        success: function(data) {
            $('#user_comments').html(data);
          }
      })
    });

});

Any ideas?

Upvotes: 2

Views: 790

Answers (2)

user2098929
user2098929

Reputation: 1

This error occurs often in tandem with another asset pipeline error when Devise is installed. Before investigating the solutions stated here rails 3.1.0 ActionView::Template::Error (application.css isn't precompiled) try Snowangel's suggestion first to save time.

Upvotes: 0

snowangel
snowangel

Reputation: 3462

Have you changed any of the coffee script files to just js files, and left the comments at the top in:

# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/

Remove these comments, if so.

Upvotes: 12

Related Questions