2013-01-17 25 views
4

我试图让一个Rails 3.2.x中的应用程序在生产环境中运行,但每次我访问部署的应用程序就抱怨资产不被编译:如何将Elastic Beanstalk获取到服务器编译的资产?

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 

我可以在生产模式运行乘客的本地实例和资产供应的罚款。有人对任何可能出错的人有所了解吗?

+0

我遇到同样的问题,部署到AWS的Elastic Beanstalk。直到最近一切都很顺利。我试着恢复到以前的提交,但我仍然得到“application.css未预编译”500错误。 – ajporterfield

回答

0

尝试通过从您的应用程序根目录运行以下命令,重新启动您的应用程序:

touch tmp/restart.txt

修正这个问题对我来说。

相关问题