2014-06-25 143 views
1

所以我创建了一个Rails 4应用程序,并且能够在第一次正确地将它推送到Heroku上游。从那以后,我一直没有经常推动我的改变。我刚刚到达一个非常重要的检查点,并决定尝试将更改推送到heroku上的实际站点,但它拒绝了我的请求,说它未能编译我的Ruby应用程序。我复制并粘贴了我的命令行提供给我的一些反馈,希望有人遇到类似的错误,并且可以给我一些关于可能出错的想法。提前致谢。在Heroku上部署轨道4的应用程序时出现Heroku拒绝我的git推送请求

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' 

回答

3

类似的错误最近对我和我所做的是预编译在我的本地机器的资产,然后将它们发送到Heroku的。

尝试在本地做:

rake assets:precompile 
git add . 
git commit -m 'assets precompiled locally' 
git push heroku master 

和它的工作。我还没有想到这样做的原因,所以任何有关这方面的见解将不胜感激。它只是以这种方式为我工作。

+0

这实际工作。我忘了这个窍门。非常感谢Hernan。 – user3324987

+0

很多帖子都说'rake assets:precompile',但没有提到'git add'所以这就是缺少的东西! – Robert

2

似乎也许你的JavaScript有错误。你能在本地运行RAILS_ENV=production rake assets:precompile --trace吗?

+0

我忘了预编译,但它现在正在工作。感谢您抽出时间帮忙。 – user3324987

+0

我的错误,是一个亭亭玉立的安装,删除它工作得很好! –

0

我是在做错误的代码如下

_companyService.get({companyId },function(result) {...

固定它作为 _companyService.get({ companyId: companyId },function(result) {...