如何在导轨上使用指南针3.1 [英] How to use compass with rails 3.1

查看:75
本文介绍了如何在导轨上使用指南针3.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我进行了搜索,我所能看到的是将罗盘与rails 3.1一起使用只是像这样编辑Gemfile:

I have searched and searched and all I could see was that to use compass with rails 3.1 was to just edit the Gemfile like so:

gem 'compass', :git => 'https://github.com/chriseppstein/compass.git', :branch => 'rails31'
gem 'sass-rails', "~> 3.1.0.rc"

是的,我知道,但是接下来呢?我看到的每个教程都是这么说的,请使用该分叉。但是我仍然无法在指南针3.1上使用指南针。

Yes I understand that but what next? Every tutorial I saw said just that, use that certain fork. But I am still having trouble with using compass with rails 3.1.

我这样做:

$ compass init rails . --syntax sass
  directory ./app/stylesheets/ 
  create ./config/compass.rb 
  create ./app/stylesheets/screen.sass 
  create ./app/stylesheets/print.sass 
  create ./app/stylesheets/ie.sass

3.1现在正在使用资产,我刚刚将所有这些文件都转移到了3.1。另外,我使用的是指南针960插件,那么在哪里需要它?我尝试添加一个要求为960且需要html5-boilerplate的罗盘.rb,但我仍然不断收到错误:

And since 3.1 was using assets now, I just transferred all those files to 3.1. Also, I am using compass-960 plugin, so where do I require it? I tried adding a compass.rb with require 960 and require html5-boilerplate and I still keep getting errors:

Error compiling asset application.css:
NoMethodError: undefined method `Error' for Compass:Module
  (in /Users/eumir/rails_apps/kiseki/app/assets/stylesheets/screen.sass)

NoMethodError (undefined method `Error' for Compass:Module
(in /Users/eumir/rails_apps/kiseki/app/assets/stylesheets/screen.sass)):

我尝试进行罗盘编译,这给了我:

I tried doing compass compile and it gave me this:

$罗盘编译
没有什么可编译的。如果您要开始一个新项目,则不要使用directory参数。
运行 compass -h以获取帮助。

$ compass compile Nothing to compile. If you're trying to start a new project, you have left off the directory argument. Run "compass -h" to get help.

正如我所说,我已经编辑了罗盘.rb,因此仍然对如何使用感到困惑关于这个。有帮助吗?

As I said, I already edited my compass.rb so I am still stumped as to how to go about with this. Any help?

推荐答案

其他答案中的解决方案不建议使用最新版本的Compass v0.12,该版本需要一个适配器以与Rails应用一起使用。指南针作者Chris Eppstein已将安装说明放在github上:

https://github.com/compass/compass-rails



此适配器支持Rails 2.3及更高版本

The solutions in the other answers are deprecated with the latest version of Compass, v0.12, which requires an adapter to work with a rails app. The Compass author, Chris Eppstein, has put installation instructions on github:
https://github.com/compass/compass-rails

This adapter supports rails versions 2.3 and greater

这篇关于如何在导轨上使用指南针3.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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