简体   繁体   English

将Rails应用程序推送到Heroku时出错

[英]Error pushing Rails application to Heroku

I'm doing an application in RoR from Linux/Ubuntu and deploying in Heroku but when I try to push to Heroku I get this error: 我正在从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'

Thanks for your help. 谢谢你的帮助。

Precompilation 预编译

Without knowing the exact error, the question arises as to what the error itself is saying. 在不知道确切错误的情况下,出现了有关错误本身在说什么的问题。 The problem you have is Heroku's precompilation system won't be able to precompile the assets for your Rails application (obviously) 您遇到的问题是Heroku的precompilation系统无法为Rails应用程序预编译资产(显然)

The causes of this could be numerous, but the main culprit is that you have syntax errors in your asset files, preventing them from being precompiled. 造成这种情况的原因可能很多,但主要的原因是资产文件中存在语法错误,导致无法对其进行预编译。

-- -

Local 本地

As recommended in the comments, you should precompile the assets locally using the following command: 如注释中所建议,您应该使用以下命令在本地预编译资产:

$ rake assets:precompile RAILS_ENV=production

This will run the precompilation process on your local machine, and will return any exceptions that occur throughout the process. 这将在本地计算机上运行预编译过程,并将返回在整个过程中发生的所有异常。

In order to get it working, you need to clean up any of the syntax errors which are returned with this local precompilation process 为了使其正常工作,您需要清理此本地预编译过程返回的任何语法错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM