我有一个ROR应用程序,我正在尝试通过加载资产管道来提高性能。
我正在调用我的布局文件
= stylesheet_link_tag 'users/application_login', :media => "all"
当我在开发中运行它时,它可以完美地运行
ss
=> Booting Thin
=> Rails 3.2.11 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
=> Debugger enabled
>> Thin web server (v1.5.1 codename Straight Razor)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:3000, CTRL+C to stop
但是当我将它作为生产运行时,它告诉我我的资产没有预编译
RAILS_ENV=production rails server
=> Booting Thin
=> Rails 3.2.11 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
>> Thin web server (v1.5.1 codename Straight Razor)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:3000, CTRL+C to stop
Started GET "/users/sign_in" for 127.0.0.1 at 2013-06-25 13:52:18 -0400
Processing by Users::SessionsController#new as HTML
Rendered users/sessions/new.html.haml within layouts/login (539.8ms)
Completed 500 Internal Server Error in 860ms
** [Airbrake] Success: Net::HTTPOK
ActionView::Template::Error (users/application_login.css isn't precompiled):
我正在运行
RAILS_ENV=production rake assets:precompile
我看到 / public / assets / users / 上的一些文件,但 application_login.css
我该怎么办?
答案 0 :(得分:4)
config.assets.precompile += %w( application_login.css )