Reputation: 29
So I created a Rails 4 app and was able to push it upstream to Heroku properly the first time. Every since then I haven't been regularly pushing my changes. I just got to a very significant checkpoint and decided to try to push my changes to the actual site on heroku but it rejects my request saying that it failed to compile my Ruby app. I've copy and pasted some of the feedback my command line provided me with in hopes that someone has had a similar error and can give me some ideas as to what might be wrong. Thanks in advance.
Running: rake assets:precompile
rake aborted!
ExecJS::ProgramError: Unexpected token name «users», expected punc «,» (line: 11341, col: 35, pos: 318042)
Error
at new JS_Parse_Error (/tmp/execjs20140625-619-93tzcv.js:2357:10754)
at js_error (/tmp/execjs20140625-619-93tzcv.js:2357:10973)
at croak (/tmp/execjs20140625-619-93tzcv.js:2357:19198)
at token_error (/tmp/execjs20140625-619-93tzcv.js:2357:19335)
at expect_token (/tmp/execjs20140625-619-93tzcv.js:2357:19558)
at expect (/tmp/execjs20140625-619-93tzcv.js:2357:19696)
at expr_list (/tmp/execjs20140625-619-93tzcv.js:2357:27763)
at /tmp/execjs20140625-619-93tzcv.js:2357:29817
at /tmp/execjs20140625-619-93tzcv.js:2357:27576
at /tmp/execjs20140625-619-93tzcv.js:2357:30108
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app
To [email protected]:picritique.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:picritique.git'
Upvotes: 1
Views: 980
Reputation: 2909
I was making mistake in code as below
_companyService.get({companyId },function(result) {...
Fixed it as
_companyService.get({ companyId: companyId },function(result) {...
Upvotes: 0
Reputation: 2156
Seems like maybe you've got an error in your JavaScript. Are you able to run RAILS_ENV=production rake assets:precompile --trace
locally?
Upvotes: 2
Reputation: 2820
A similar error occurred to me recently when deploying a rails 4 app on heroku, and what I did was to precompile the assets in my local machine and then send them to heroku.
Try to do in your local:
rake assets:precompile
git add .
git commit -m 'assets precompiled locally'
git push heroku master
And it worked. I haven't figured the reason yet to do this, so any insight on this will be appreciated. It just worked for me in this way.
Upvotes: 3