Ruby on Rails Rake 资产:预编译错误 [英] Ruby on Rails Rake assets:precompile error
问题描述
我是 Rails 开发的新手,这是我第一次部署到 Heroku.当我执行我的应用程序时(部署后)有一个错误:
I'm new in Rails development and this is my first deployment to Heroku. When I execute my application (after the deployment) there is an error:
2011-09-18T21:05:54+00:00 app[web.1]: Completed 500 Internal Server Error in 10ms
2011-09-18T21:05:54+00:00 app[web.1]:
2011-09-18T21:05:54+00:00 app[web.1]: ActionView::Template::Error (application.css isn't precompiled):
我用谷歌搜索了这个,发现我必须预编译我的资产,但在尝试这样做时我发现了另一个错误:
I googled this and found that I have to precompile my assets, but when trying to do this I found an other error:
$ bundle exec rake assets:precompile RAILS_ENV=production
rake aborted!
No such process - /usr/lib/ruby/gems/1.8/gems/pg-0.11.0/lib/pg_ext.so
(See full trace by running task with --trace)
我还没有找到针对此问题的任何解决方案.有没有遇到过这个问题的人知道如何解决这个问题?
I haven't found any solution for this issue. Is there anyone who faced this an know how to solve this problem?
推荐答案
我也遇到了这个问题,我通过执行以下操作解决了它:
I ran into this issue as well and I resolved it by doing the following:
打开 config/environments/production.rb
并确保以下选项设置为 true
:
Open up config/environments/production.rb
and make sure the following option is set to true
:
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
然后运行:
rake assets:precompile --trace RAILS_ENV=production
希望这会有所帮助!
~凯文
这篇关于Ruby on Rails Rake 资产:预编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!