大部分情况下我都遵循规定的方向here http://tesoriere.com/2011/08/08/migrating-from-rails-3.1-rc4-to-rc5-using-heroku%27s-cedar-stack--also-compass--unicorn--and-sendgrid-/
这导致了来自它要求我创建的初始化程序的以下错误:
from /app/config/initializers/sass.rb:1:in `<top (required)>'
2011-09-05T16:45:42+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties- 3.1.0/lib/rails/railtie/configuration.rb:78:in `method_missing': undefined method `sass' for # <Rails::Application::Configuration:0x00000003845528> (NoMethodError)
Heroku 的入门页面也没有太大帮助。它基本上是相同的指令,只是没有初始化程序。然而,如果没有它,它就找不到任何蓝图的东西,所以我仍然无法开始。
有人比我更进一步吗?
编辑更多历史记录:
我经历了很多错误才来到这里,所以我想我应该把它们全部写出来。我遇到的第一个问题是 html5-boilerplate 位于 :assets 中,这意味着找不到 ie_html 方法,所以我将其从 :assets 中取出。
这导致了此错误,因为 html5-boilerplate 依赖于指南针:
2011-09-05T17:15:47+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/bundler/gems/compass-b7f44a48d375/lib/compass/version.rb:56:in `const_missing': uninitialized constant Compass::Frameworks (NameError)
2011-09-05T17:15:47+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/bundler/gems/compass-html5-boilerplate-405f9ddbca56/lib/html5-boilerplate.rb:1:in `<top (required)>'
最后,最终的解决方案是让 sass-rails 全球化(或者至少看起来是这样)。我觉得我终于在巧合下成功了,但它就是这样。
我将指南针从 :assets 中取出,并将其设置为全局。这导致编译 SCSS 文件时出现错误,最终导致我升级到 Ceder,从而导致蓝图丢失错误。
最后,我添加了初始化程序,我认为它的目的是将指南针框架内容添加到配置路径中。希望一切有帮助。
这是相关代码:
gem 'heroku'
gem 'haml'
gem 'compass', :git => 'git://github.com/chriseppstein/compass.git'
gem 'html5-boilerplate', :git => 'git://github.com/sporkd/compass-html5-boilerplate.git'
gem 'sass-rails', " ~> 3.1.0"
请注意 compass 和 html5-boilerplate 的 github 版本(如果不使用 h5bp,则不需要)。
初始化器是:
Rails.configuration.sass.tap do |config|
config.load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets"
end
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)