【发布时间】:2013-01-01 07:59:54
【问题描述】:
我试图让 Rails 3.2.x 应用程序在生产环境中运行,但每次我访问已部署的应用程序时,它都会抱怨资产没有被编译:
An ActionView::Template::Error occurred in home#index:
application.css isn't precompiled
vendor/bundle/gems/actionpack-3.2.11/lib/sprockets/helpers/rails_helper.rb:142:in `digest_for'
-------------------------------
Request:
-------------------------------
* URL : http://some-server.elasticbeanstalk.com/
* Parameters: {"controller"=>"home", "action"=>"index"}
* Rails root: /var/app/current
* Timestamp : 2013-01-17 17:22:55 UTC
但是,当我查阅我的 EB 实例的日志文件时,我将此视为每次部署的一部分:
Script succeeded.
Executing script: /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh
Output from script: /usr/bin/ruby1.9 /usr/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
我可以在生产模式下运行本地乘客实例,并且资产服务良好。有没有人知道可能出了什么问题?
【问题讨论】:
-
我在部署到 AWS 的 Elastic Beanstalk 时遇到了同样的问题。直到最近,一切都运行良好。我尝试恢复到以前的提交,但我仍然收到“application.css 未预编译”500 错误。
标签: ruby-on-rails asset-pipeline amazon-elastic-beanstalk