无法获得Heroku Cedar上的Rails 3.1,Compass,Sass,Blueprint [英] Unable to get Rails 3.1, Compass, Sass, Blueprint working on Heroku Cedar

查看:97
本文介绍了无法获得Heroku Cedar上的Rails 3.1,Compass,Sass,Blueprint的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大多数情况下,我都遵循了布置的方向这里

其中导致来自它要求我创建的初始化程序的以下错误:

 来自/ app / config / initializers / sass。 rb:1:在<顶部(必填)>'
2011-09-05T16:45:42 + 00:00应用[web.1]:/app/vendor/bundle/ruby/1.9。 1 / gems / railties- 3.1.0 / lib / rails / railtie / configuration.rb:78:in`method_missing':未定义的方法`sass'为#< Rails :: Application :: Configuration:0x00000003845528> (NoMethodError)

入门的Heroku页面也没有多大帮助。基本上只有没有初始化器的指令才是相同的。但如果没有它,那么它无法找到任何蓝图,所以我仍然无法启动。



有谁比我有更多的进展?



编辑更多历史记录:

>

我经历了很多错误才到达这里,所以我想我应该把它们写出来。我遇到的第一个问题是html5样板文件位于:资产,这意味着ie_html方法没有找到,所以我将其从资产中提取出来。
$ b 这导致了这个错误,因为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:在`const_missing'中:未初始化的常量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成为全局的(或者至少它似乎已经)。我有点觉得我终于通过共同作用得到了这个工作,但在这里。

我从资产中拉出了指南针,并使它成为了全球化。这导致编译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

请注意指南针和html5-boilerplate的github版本(如果您不使用它,则不需要h5bp)。



初始化程序是:

  Rails.configuration.sass.tap do | config | 
config.load_paths<< #{gem.loaded_specs ['compass']。full_gem_path} / frameworks / compass / stylesheets
end


For the most part I've followed the direction laid out here

Which is resulted in the following error coming from the initializer it asked me to create:

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)

The Heroku page on getting started isn't much help either. It is basically the same instructions only without the initializer. However without it, then it can't find any of the blueprint stuff so I still can't start.

Anyone out there who has made it further than I have?

Edit for more history:

I went through a number of errors to get here so I figured I should write them all out. The first problem I had was that html5-boilerplate was in :assets which meant that the ie_html method wasn't found, so I pulled that out of :assets.

This resulted in this error because html5-boilerplate depends on compass:

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)>'

解决方案

In the end the final solution was to also make sass-rails global (or at least it appears to have been). I sort of feel like I finally got this to work by co-incidence but here it is.

I pulled compass out of :assets and made it global too. Which then led to errors with compiling the SCSS files which finally led me to upgrade to Ceder which then resulted in the blueprint missing errors.

Lastly I added the initializer which, I assume, is meant to add the compass framework stuff to the config path. Hope that all helps.

Here is the relevant code:

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"

Note the github versions for compass and html5-boilerplate (you don't need h5bp if you don't use it).

The initializer is:

Rails.configuration.sass.tap do |config|
  config.load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets"
end

这篇关于无法获得Heroku Cedar上的Rails 3.1,Compass,Sass,Blueprint的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆