Ruby on Rails预编译资产失败 [英] Ruby on Rails Precompiling assets failed
本文介绍了Ruby on Rails预编译资产失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在关注rails的reInteractive ruby(15分钟的博客),并且在帖子结尾(第二部分),我使用heroku上传我的文件时出现错误:
!预编译集合失败
!推送被拒绝,未能编译Ruby应用程序
到git@heroku.com:peaceful-sea-8032.git
! [remote rejected] master - > master<预接收钩拒绝>
错误:无法将一些文件推送到'git@heroku.com:peaceful-sea-8032.git'
ps:该应用在localhost上运行良好,我看到了一些类似的问题,但是我没有成功尝试他们的解决方案。
RAILS_ENV =生产捆绑包exec rake资产:预编译
code> 这会在本地预编译您的资产
然后您必须
git add。
git commit -am'预编译资产'
git push heroku
(eddited最后一行)
I've been following the reInteractive ruby on rails (15 min blog), and in the end of the post (second part), I got an error using heroku to upload my files:
! Precompiling assests failed
!Push rejected, failed to compile Ruby app
To git@heroku.com:peaceful-sea-8032.git
! [remote rejected] master -> master <pre-receive hook declined>
error: failed to push some refs to 'git@heroku.com:peaceful-sea-8032.git'
ps: The app runs fine on localhost, I saw some similar question but I did not have success trying their solutions.
解决方案
Precompile your assets locally. In your shell cd to your application folder and enter:
RAILS_ENV=production bundle exec rake assets:precompile
This will precompile your assets locally Then you have to
git add .
git commit -am 'precompiled assets'
git push heroku
(eddited last line)
这篇关于Ruby on Rails预编译资产失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文