Rails指南针库

时间:2009-12-28 13:20:38

标签: ruby-on-rails sass compass-sass

我已经通过rubygems

安装了指南针

doug:aggio davide $ sudo gem list compass

*本地宝石*

指南针(0.10.0.pre2) 指南针颜色(0.3.1)

*本地宝石*

花式按钮(0.3.7)

*本地宝石*

haml(2.2.16,2.2.14,2.2.13,2.2.10,2.2.9,2.2.6,2.2.4,2.2.3,2.2.2,2.2.1,2.2.0,2.0 .10,2.0.9) 边缘(2.3.100,2.3.97,2.3.83,2.3.67,2.3.62,2.3.43,2.3.29,2.3.27,2.3.21,2.1.56,2.1.41,2.1。 8,2.1.3)

Rails配置

compass.rb

require 'compass'
require 'compass-colors'
require 'fancy-buttons'


# If you have any compass plugins, require them here.
Compass.configuration.parse(File.join(RAILS_ROOT, "config", "compass.config"))
Compass.configuration do |config|
  config.project_path = RAILS_ROOT
  config.sass_dir = "app/stylesheets"
  config.css_dir = "public/stylesheets/compiled"
end

Compass.configuration.environment = RAILS_ENV.to_sym
Compass.configure_sass_plugin!

compass.config

# Require any additional compass plugins here.

project_type = :rails
project_path = RAILS_ROOT if defined?(RAILS_ROOT)
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "public/stylesheets/compiled"
sass_dir = "app/stylesheets"
images_dir = "public/images"
javascripts_dir = "public/javascripts"

# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
http_images_path = "/images"
http_stylesheets_path = "/stylesheets"
http_javascripts_path = "/javascripts"

这是关于指南针的一些信息:

doug:aggio davide$  ./script/runner "require 'pp'; pp Sass::Plugin.options" 
{:style=>:expanded,
 :line_comments=>true,
 :css_location=>"/Users/davide/Code/aggio/public/stylesheets",
 :cache_location=>"/Users/davide/Code/aggio/tmp/sass-cache",
 :template_location=>"/Users/davide/Code/aggio/app/stylesheets",
 :always_update=>false,
 :always_check=>true,
 :full_exception=>true}

主要问题是模板位置(罗盘库?)。 当我导入blueprint.sass或其他资源exsple花式按钮时,指南针找不到库并返回此

要导入的文件未找到或不可读:blueprint.sass

但是,如果我在/ app / stylesheets中复制蓝图和指南针库,它的效果很好。 我的问题是:我每次都需要从指南针宝石中提取库,或者路径有问题吗?

1 个答案:

答案 0 :(得分:1)

如果您正在运行Compass 0.10,问题可能是因为库已经转换为scss语法而您正在调用“blueprint.sass”。

您可以在没有扩展名的情况下引用它们,它应该可以正常工作:

@import 'blueprint'

此外,不再需要指南针颜色,这些功能已经滚动到sass中(在haml gem中)。

更新:它不再是haml gem的一部分,它现在是一个独立的sass gem。