我有一個Ruby on Rails OpenShift應用程序(ruby 1.9,Rails Rails 3.2.13),在開發環境中沒有問題。然而,當我將應用程序部署到OpenShift,我得到以下錯誤:資產沒有預編譯在RoR Openshift應用程序
ActionView::Template::Error (logo.png isn't precompiled):
2: <header>
3: <div id="header" class="clearfix landing_header">
4: <a href="#" id="logo">
5: <%= image_tag("logo.png") %>
6:
7: </a>
我的理解是錯誤說logo.png不預編譯。這將使意義,因爲這些指令都在我的production.rb
環境設置:
config.serve_static_assets = false
config.assets.compress = true
config.assets.compile = false
config.assets.digest = true
嗯,是我的資產預編譯?當我部署我的應用程序(使用git push
),我可以等等看:
remote: Precompiling with 'bundle exec rake assets:precompile'
而且沒有錯誤。即使我使用SSH尋找預編譯的資產在OpenShift回購,我可以看到它在那裏,再與其他許多人:
> ls public/assets | grep logo
logo-66589ea9e7a1caa7f2151a721d6cdbd2.png
當我在瀏覽器中打開我的應用程序地址/資產/文件^^,我可以看到它。唯一的問題是image_tag沒有。
我在做什麼錯?資產是預編譯的,不是嗎?我是否錯誤地使用了image_tag?提前致謝!
聽起來像它與這個問題有關:https://github.com/openshift/origin-community-cartridges/issues/8 – user1116573 2014-09-27 11:06:54