4

我正在尝试让 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

我可以在生产模式下运行本地乘客实例,并且资产服务良好。有没有人对可能出现的问题有任何见解?

4

1 回答 1

0

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

touch tmp/restart.txt

为我解决了这个问题。

于 2013-03-19T06:23:40.213 回答