Ruby on rails 罗盘轨道宝石没有在heroku运行?
我的gemfile最近升级了我的compass rails gem。我开始出现以下错误(仅在heroku上生产-在本地工作正常),并已被困数小时:Ruby on rails 罗盘轨道宝石没有在heroku运行?,ruby-on-rails,ruby,ruby-on-rails-3,heroku,compass-sass,Ruby On Rails,Ruby,Ruby On Rails 3,Heroku,Compass Sass,我的gemfile最近升级了我的compass rails 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 foun
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/出现在这里的路径中,但我不明白为什么。当我将下面的compass配置更改为“资产/样式表”时,我仍然会在跟踪错误中看到/app/app/
production.rb:
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
compass.rb
# Require any additional compass plugins here.
project_type = :rails
sass_dir = "app/assets/stylesheets"
Gemfile
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier', '1.2.4'
gem 'yui-compressor', '0.9.6'
gem 'compass-rails'
end
在my application.css.scss文件中:
@import "compass/css3";
到目前为止,我一直在尝试我能找到的每一个解决方案
有什么突出的地方吗?我将我的rails升级到了3.2+版本,并最终将compass rails移出资产组以使其正常工作。我真的不明白它为什么会起作用,但它似乎起到了作用。是的,将指南针轨道移出:资产是可行的,但不是理想的解决方案 检查我找到的推送到heroku的输出
Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
但它是在本地编译的
RAILS_ENV=production rake assets:precompile
解决方案是在预编译资产时不实例化DB。在config/application.rb中:
config.assets.initialize_on_precompile = false
请参见compass rails项目中的此问题:
将compass rails移出:assets有效的原因是Heroku正在尝试动态编译样式表,因为
rake assets:precompile
失败。然而,它肯定只是一个变通解决方案——Rimian的解决方案使预编译工作正常,compass rails肯定应该保留在:assets组中。