2

本番環境で rails + nginx + unicorn でエラーが発生しました

ActionView::Template::Error (application.css がプリコンパイルされていません):

sqlite3 でクリーンな Rails アプリをデプロイしようとしています。http://cayennepower.ru/postsにアクセスすると、申し訳ありませんが、エラーが発生しました。フロント ページでは、静的なウェルカム ページが適切に機能します。私のアプリ/ログの production.log には、このようなエラーがあります

Started GET "/posts" for 127.0.0.1 at 2012-12-12 06:47:48 +0100
Processing by PostsController#index as */*
Rendered posts/index.html.erb within layouts/application (0.4ms)
Completed 500 Internal Server Error in 3ms

ActionView::Template::Error (application.css isn't precompiled):
2: <html>
3: <head>
4:   <title>CleanRails</title>
5:   <%= stylesheet_link_tag    "application", :media => "all" %>
6:   <%= javascript_include_tag "application" %>
7:   <%= csrf_meta_tags %>
8: </head>
app/views/layouts/application.html.erb:5:in   `_app_views_layouts_application_html_erb___741543018_80365330'
app/controllers/posts_controller.rb:7:in `index'

config/enviroments/production.rb に配置しました

config.assets.compile = true

config.assets.precompile += %w( application.css )

rake assets:precompile --trace RAILS_ENV=production を実行しました

トレースログは

** Invoke assets:precompile (first_time)
** Execute assets:precompile
/usr/local/rvm/rubies/ruby-1.9.3-p327/bin/ruby /usr/local/rvm/gems/ruby-1.9.3-p327/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
** Invoke assets:precompile:nondigest (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:nondigest

しかし、私はまだこのエラーがあります

私のnginx.confは

    upstream cayennepower.ru {
   server unix:/home/sites/cayennepower.ru/www/tmp/sockets/unicorn.sock;
   # server 127.0.0.1:3000 fail_timeout=0;
}

私のdomain.confファイルは

server {
listen 80;
server_name cayennepower.ru;
root /home/sites/cayennepower.ru/www/public;
try_files $uri/index.html $uri @unicorn;
location @unicorn {
    #if (!-f $request_filename) {
        proxy_pass http://cayennepower.ru;
        break;
    #}
}

}

みんな助けてくれてどうもありがとう!

4

0 に答える 0