简体   繁体   English

Ruby on Rails + Passenger无法加载缓存的资产

[英]Ruby on Rails + Passenger unable to load cached assets

I just installed passenger and I believe I got it working, but now my rails application seems to be unable to load cached assets. 我刚刚安装了乘客,并且我相信它可以工作,但是现在我的rails应用程序似乎无法加载缓存的资产。 When attempting to load a page I get this message: 尝试加载页面时,出现以下消息:

ActionView::Template::Error (No such file or directory - /home/glawson/vidStream/tmp/cache/assets/sprockets%2Ff1663d34d4b6003379113df98f1433a520130421-27670-18ux0pw.lock): ActionView :: Template :: Error(没有这样的文件或目录-/home/glawson/vidStream/tmp/cache/assets/sprockets%2Ff1663d34d4b6003379113df98f1433a520130421-27670-18ux0pw.lock):

2: <html>
3: <head>
4:   <title>VidStream</title>
5:   <%= stylesheet_link_tag    "application", :media => "all" %>
6:   <%= javascript_include_tag "application" %>
7:   <%= csrf_meta_tags %>
8:

app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb___4187138815701226714_20468720' app / views / layouts / application.html.erb:5:in _app_views_layouts_application_html_erb___4187138815701226714_20468720

This happens when I try to run my webapp with passenger or in development with rails server. 当我尝试在乘客上运行我的Web应用程序或在Rails服务器上进行开发时,会发生这种情况。 I'm a little fuzzy on what the error even means other than it can't find a file that it's looking for. 除了无法找到要查找的文件外,我对该错误的含义还有些模糊。

In production mode you need to precompile the asset directory using 在生产模式下,您需要使用以下命令预编译资产目录

RAILS_ENV=production rake assets:precompile

Then only it will work. 然后,它将起作用。 Because by default for prod asset precompile is enabled. 因为默认情况下,产品资产预编译已启用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM