我正在構建一個引擎,我將它捆綁爲一個gem(gmaps4rails)。我將我的引擎的/ public公開在我的rails應用程序的/ public中。Rails 3引擎和靜態資產
一切工作正常的發展,但無法在生產中工作:它顯示靜態資產(我的引擎&我的主要應用程序)沒有找到。
日誌跟以下(只是一個抽象的):
Started GET "/javascripts/application.js?1286294679" for 127.0.0.1 at Wed Nov 24 00:22:20 +0100 2010
ActionController::RoutingError (No route matches "/javascripts/application.js"):
Rendered /Users/me/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.1ms)
Started GET "/stylesheets/gmaps4rails.css?1290554221" for 127.0.0.1 at Wed Nov 24 00:22:20 +0100 2010
ActionController::RoutingError (No route matches "/stylesheets/gmaps4rails.css"):
我已經做了幾件事情:
在我的應用程序的production.rb,我設置:
config.serve_static_assets = true
這解決了問題,但不夠優雅,我想要ke ep它假和在引擎中添加配置:)
我跟着 here建議沒有成功。
謝謝您的回答,我沒有嘗試,但它並沒有任何區別:) – apneadiving 2010-11-24 17:36:53