我已经通过 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)haml-edge(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)
导轨配置
指南针.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!
指南针配置
# 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 或其他资源例如花哨的按钮时,指南针找不到库并返回这个
找不到或无法读取要导入的文件:blueprint.sass
但是,如果我在 /app/stylesheets 中复制蓝图和指南针库,效果会很好。我的问题是:我每次都需要从指南针宝石中提取库,还是路径有问题?