[英]compass-rails gem not being run in heroku?
我的gemfile最近升級了我的指南針-gem。 我開始遇到以下錯誤(僅在heroku上生產-在本地可以正常運行),並已停留了幾個小時:
Completed 500 Internal Server Error in 14284ms
2012-09-03T20:53:25+00:00 app[web.1]:
2012-09-03T20:53:25+00:00 app[web.1]: ActionView::Template::Error (File to import not found or unreadable: compass/css3.
2012-09-03T20:53:25+00:00 app[web.1]: Load path: Sass::Rails::Importer(/app/app/assets/stylesheets/application.css.scss)
我認為問題的部分原因必須在於/ app / app /出現在此處的路徑中-但我不明白為什么。 當我將下面的指南針配置更改為“資產/樣式表”時,在跟蹤錯誤中我仍然看到/ app / app /。
production.rb:
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
羅盤
# Require any additional compass plugins here.
project_type = :rails
sass_dir = "app/assets/stylesheets"
寶石文件
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier', '1.2.4'
gem 'yui-compressor', '0.9.6'
gem 'compass-rails'
end
在我的application.css.scss文件中:
@import "compass/css3";
到目前為止,我一直在嘗試可以找到的所有解決方案,但沒有任何運氣
有什么突出嗎?
是的,將羅盤導軌移出:assets可以,但是不是理想的解決方案。
通過檢查推送到我發現的heroku的輸出
Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
但是它正在本地編譯
RAILS_ENV=production rake assets:precompile
解決方案是在預編譯資產時不實例化數據庫。 在config / application.rb中:
config.assets.initialize_on_precompile = false
在指南針項目中查看此問題:
我將滑軌升級到3.2+,並最終將指南針滑軌移到資產組之外以使其正常運行。 我真的不明白為什么它起作用,但是它似乎可以解決問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.