我已經完成了這個在我的Leopard網絡服務器上使用生產的姐妹Rails 3.1應用程序。所以我沒有想到會失去這個應用程序的部署。我已經得到乘客認識的應用程序,但我得到'[GET /]錯誤在Apache中的錯誤。環顧四周我想我可以得到這個在webrick中運行,看看我是否可以找出問題。鐵軌生產的'CSS是不是預編譯'
束EXEC耙資產:預編譯RAILS_ENV =生產
但是當我加載本地主機:3000我碰到一個「藍圖/ screen.css不預編譯」
我開始比較妹妹之間的差異應用程序並找不到它們。這裏是他們分享的一些關鍵代碼:
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %> #in app/views/layouts/application.html.erb
config/environments/production.rb
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = false
config.assets.precompile += %w(search.js)
config.assets.precompile += %w(blueprint/screen.css blueprint/print.css)
config.assets.precompile += %w(*.css *.js)
這發生在3.1.0和3.1.3,我可以確認預編譯發生在藍圖目錄上。我可以忽略什麼?,山姆
我遇到了一個「gotcha」,其中逗號分隔了'%w()'中的項目,這些逗號成爲數組項的一部分而不是將它們分開。例如。 '%w(blueprint/screen.css,blueprint/print.css)#=> ['blueprint/screen.css','blueprint/print.css']' – 2015-07-05 23:12:41