簡體   English   中英

將Rails應用程序推送到Heroku時出錯

[英]Error pushing Rails application to Heroku

我正在從Linux / Ubuntu用RoR編寫一個應用程序,並在Heroku中進行部署,但是當我嘗試推送到Heroku時,出現此錯誤:

       Tasks: TOP => assets:precompile
       (See full trace by running task with --trace)
 !
 !     Precompiling assets failed.
 !

 !     Push rejected, failed to compile Ruby app

To git@heroku.com:herokuangelapp.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:herokuangelapp.git'

謝謝你的幫助。

預編譯

在不知道確切錯誤的情況下,出現了有關錯誤本身在說什么的問題。 您遇到的問題是Heroku的precompilation系統無法為Rails應用程序預編譯資產(顯然)

造成這種情況的原因可能很多,但主要的原因是資產文件中存在語法錯誤,導致無法對其進行預編譯。

-

本地

如注釋中所建議,您應該使用以下命令在本地預編譯資產:

$ rake assets:precompile RAILS_ENV=production

這將在本地計算機上運行預編譯過程,並將返回在整個過程中發生的所有異常。

為了使其正常工作,您需要清理此本地預編譯過程返回的任何語法錯誤。

暫無
暫無

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

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