Reputation: 1968
im getting a problem with my deploy at heroku! I just created an app Test with cedar stack, push my app and I have this problem (log)
←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m ActionView::Template::Error (Unexpected token: operator (<)
←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m (in /app/app/assets/javascripts/application.js)):
←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m 3: <head>
←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m 4: <title>Test</title>
←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m 5: <%= stylesheet_link_tag "application" %>
←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m 6: <%= javascript_include_tag "application" %>
←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m 7: <%= csrf_meta_tags %>
←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m 8: </head>
←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m 9: <body>
Any Idea??
Update:
My application.js file
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require_tree .
Upvotes: 4
Views: 2933
Reputation: 2373
NOTE: it's been almost 7 years since the OP asked this question. The issue I experienced is likely a newer problem (with the same error log output as OP). The below answer likely doesn't apply to the issue the OP experienced, but could be helpful to new visitors looking for a solution. My Rails version:
5.1.2
It was an issue with how Production handles my assets.precompile
(in config/initializers/assets.rb
)
After trial-and-error to find the culprit (a new JS file I created a week ago), I noticed the error vanished after commenting out the line that includes the file in config/initializers/assets.rb
.
# Commented out until precompile fix found
# Rails.application.config.assets.precompile += %w( break_the_project.js )
Since this only happened in Production for me, I updated config/environments/production.rb
, replacing the line:
config.assets.js_compressor = :uglifier
to:
config.assets.js_compressor = Uglifier.new(harmony: true)
After restarting the Rails server, my World was peaceful once again.
Upvotes: 0
Reputation: 572
I ran into this error and it took a while to figure out which file referenced in the manifest was the culprit. Once I figured out which file was causing the error, searching for '>' pulled up several lines but I got lucky and quickly zeroed in a map function which used the =>
operator:
.map(x => x.id);
Once I changed that to an anonymous function:
.map(function(x) { return x.id; });
the error went away.
Upvotes: 1
Reputation: 61
I've just run into this problem, and the trick was that there was a remaining line of a conflict between the server and my localhost. In my localhost everything seamed fine, but i think that's because of some cache, or something. Anyway, i opened the application.js and remove the lines with the << HEAD...
I let it here for register of the problem and a possible solution
Upvotes: 0