簡體   English   中英

推送到Heroku被拒絕

[英]Push to Heroku being rejected

我創建了一個基於RoR的簡單網站。 我創建了一個Git存儲庫,並嘗試將其部署到Heroku,但它始終失敗:

    remote:        rake aborted!
    remote:        ExecJS::ProgramError: Unexpected character '#' (line: 10848, col: 0, pos: 303135)
    remote:        Error
    remote:        at new JS_Parse_Error (/tmp/execjs20151027-1005-1i4h7l5js:2359:10623)
    remote:        at js_error (/tmp/execjs20151027-1005-1i4h7l5js:2359:10842)

(為簡潔起見,打破了錯誤)

    remote:        Tasks: TOP => assets:precompile
    remote:        (See full trace by running task with --trace)
    remote:  !
    remote:  !     Precompiling assets failed.
    remote:  !
    remote:
    remote:  !     Push rejected, failed to compile Ruby app
    remote:
    remote: Verifying deploy....
    remote:
    remote: !   Push rejected to serene-depths-4806.
    remote:
    To https://git.heroku.com/serene-depths-4806.git
     ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'https://git.heroku.com/serene-depths-4806.git'

難道說不應該有一個“#”嗎? 我不知道如何找到,即使給出了。

另外,我從sqlite更改為postgresql,並在gemfile和database.yml文件中進行了更改。 然后,我刪除了舊的Heroku遠程分支,並按照以下說明嘗試進行部署: https : //devcenter.heroku.com/articles/git#deploying-code

任何建議表示贊賞!

啊,當然,寫完這篇文章后,我找到了答案(針對那些將來可能遇到相同問題的人):

這是因為“#”錯誤是在我從自動coffeescript文件轉換而來的.js文件中。 衛生署! 我只是刪除了文件頂部的注釋並進行了部署。

這可能是由於資產預編譯失敗而導致的,並且阻止了heroku部署過程。

您可以嘗試在本地編譯資產以檢查錯誤

RAILS_ENV=production bundle exec rake assets:precompile --trace

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM