Error when running `rake assets:precompile`
Take a look at this url this is almost same error.
https://github.com/resolve/refinerycms/issues/1186
Fix is here :
https://github.com/resolve/refinerycms/pull/1189
Summary: Your are missing 'comma' sign or 'semicolon' sign somewhere in your application.js file.
Log full trace here while running locally by following command:
bundle exec rake assets:precompile --trace
Can't Precompile Rails Assets Due to Uglifier Punc Error
It seems that you are using a feature of ES6 that is not supported by Uglifier: http://es6-features.org/#PropertyShorthand.
I think Uglifier's target is ES5 and won't accept anything but ES5 code. You can do a rapid fix by rewriting your code in ES5:
$.ajax({
url: "/products/per_amount",
data: {id: quantity, product: product},
dataType: "json",
type: "GET",
If you want to retain your syntax goodies look into using Babel to transpile your code into ES5.
Deploying to Heroku: ExecJS::RuntimeError: SyntaxError: Unexpected token
What ended up solving this problem for me (this time, at least), was to:
- precompile the assets locally (rake assets:precompile). This created two files on the local system - think they were gz files).
- Commit and push to Heroku. It worked after this.
Although, this explains nothing to me. I have never needed to precompile assets before. And, if it was necessary to do, why did the localhost always work without executing this command? And, Heroku always attempts to precompile the assets. Why did it succeed when I pushed, supposedly, pre-precompiled assets? Doesn't it redo the precompilation anyway?
So, for now, the problem is solved. I have no idea why.
heroku rake assets:precompile failed unknown compressor
Go to config/environments/production
and remove or comment out the line:
config.assets.css_compressor = :purger
Related Topics
Storing Objects in a Session in Rails
How to Redirect Stderr and Stdout to File For a Ruby Script
How to Make an Http Get With Modified Headers
Rails Installation Failed on Ubuntu With "Cannot Load Such File - Mkmf"
Why Should We Avoid Using Class Variables @@ in Rails
Rails: Skinny Controller Vs. Fat Model, or Should I Make My Controller Anorexic
Getting a "Bad Interpreter" Error When Using Brew
Ruby Gsub Doesn't Escape Single-Quotes
How to Install MySQL2 Gem on Windows 7
Can't Access Rubygems - Possibly Due to Ssl
Read and Write Yaml Files Without Destroying Anchors and Aliases
Calculating the Number of Weeks in a Year with Ruby
How to Use Double Brackets in a Regular Expression
Database.Yml &References Not Working
Ruby on Windows Causes Error Cannot Load Such File Bcrypt_Ext