2012-04-05 88 views
0

我正在嘗試部署Rails應用程序...並且我遵循capistrano部署指南。我被困在測試階段,我應該在rails控制檯中運行app.get(「/」)。當我這樣做時,我收到了一條與我在我的應用中使用的藍圖css工具相關的錯誤消息。有沒有人遇到過關於藍圖未被預編譯的類似錯誤?我不知道下一步該怎麼做才能解決這個錯誤。預先感謝您的任何建議!Rails應用程序部署錯誤 - 'blueprint/screen.css未預編譯'

下面是從日誌文件輸出中的錯誤:

Started GET "/" for 12.13.14.15 at 2012-04-05 14:15:50 -0700 
Processing by PagesController#home as HTML 
Rendered pages/home.html.erb within layouts/application (1.1ms) 
Rendered layouts/_stylesheets.html.erb (1.3ms) 
Completed 500 Internal Server Error in 6ms 

ActionView::Template::Error (blueprint/screen.css isn't precompiled): 
    1: <!--[if lt IE9]> 
    2: <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> 
    3: <![endif]--> 
    4: <%= stylesheet_link_tag 'blueprint/screen', :media => 'screen' %> 
    5: <%= stylesheet_link_tag 'blueprint/print', :media => 'print' %> 
    6: <!--[if lt IE 8]><%= stylesheet_link_tag 'blueprint/ie' %><![endif]--> 
    7: <%= stylesheet_link_tag 'custom', :media => 'screen' %> 
    app/views/layouts/_stylesheets.html.erb:4:in `_app_views_layouts__stylesheets_html_erb___2010157553399413981_33056460' 
    app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb__4294160261947576619_31749320' 
+1

你說這個錯誤發生在測試階段?那麼發展的環境不同? 你檢查了你的環境? 從Rails 3.1開始,它假設資產是預編譯生產的。因此,您可能需要在本地預編譯資產並將其添加到您的資源庫或預編譯資產服務器端。 我喜歡用capistrano recipy編譯資產serverside。 – Deradon 2012-04-05 21:58:23

+0

我的意思是測試階段是:我正在從軌道控制檯測試什麼是生產應用程序。你是對的,這絕對是一個資產預編譯問題,我不知道這一點。謝謝。你可以用capistrano建議任何有關資產預編譯服務器的好文檔嗎?我對ROR和Capistrano很新。 – 2012-04-06 00:50:42

回答

3

嘗試將其添加到你的config/application.rb中

config.assets.precompile =%W(screen.css)

+0

保留在production.rb中,因爲development.rb可能不需要預編譯 – Sairam 2012-04-05 22:01:56

+0

正確,好點。 – Webjedi 2012-04-05 22:14:30

+0

太棒了。這似乎奏效了!謝謝一堆。 – 2012-04-06 00:08:25