13

我想通过mac终端安装指南针。我安装了萨斯。我现在有 Sass 3.3.0.alpha.175(出血边缘)

然后我尝试用 sudo gem install compass 安装指南针它给了我这个警告

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block

然后说明“已安装 1 个 gem”

当我运行指南针时,它不起作用,它给了我这些行:

/Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:110:in `gem_original_require': no such file to load -- sass/script/node (LoadError)
    from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:110:in `require'
    from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1
    from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:45:in `gem_original_require'
    from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2
    from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `each'
    from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1
    from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:45:in `gem_original_require'
    from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9
    from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:45:in `gem_original_require'
    from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass.rb:5
    from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass.rb:4:in `each'
    from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/lib/compass.rb:4
    from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:45:in `gem_original_require'
    from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:20
    from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:8:in `fallback_load_path'
    from /Library/Ruby/Gems/1.8/gems/compass-0.12.2/bin/compass:19
    from /usr/bin/compass:23:in `load'
    from /usr/bin/compass:23

有没有办法解决这个问题到目前为止我使用了codekit。但我想利用源地图,我相信终端是唯一的方法。我尝试将 sass 与源映射一起观看,结果很漂亮(因为我可以使用 chrome 作为编辑器)。但我也想在其中添加指南针

有没有办法让这个工作 - 我使用的是操作系统版本 10.8.3

谢谢

4

3 回答 3

27

Compass 与 sass 3.3.0 alpha 不兼容(参见gem doc)。您应该卸载 compass 和 sass,并且使用sudo gem install compasswhich 重新安装也将安装 sass(使用正确的版本)。

编辑:

今天(2017 年 2 月 26 日)刚刚尝试使用 rvm 安装 compass,但偶然发现了另一个错误:Error compiling Compass LoadError on line [“179”] .. data.rb: Cannot load such file. 这个答案对我有用。

于 2013-06-14T07:54:00.517 回答
9

值得一提的是,如果您使用的是 RVM,请不要使用 sudo。以下是我解决这个问题的方法(我使用 Alexandre 的回答来到这里):

1)$ gem uninstall sass (对提醒您依赖关系的提示说“是”,无论如何您都将重新安装)

2)$ gem install sass -v 3.2.10

在那之后,指南针工作得很好

于 2014-01-10T19:47:54.737 回答
3

在我的解决方案中:我已经安装了 ruby​​。brew install ruby​​ (我知道已经安装了mac)然后 sudo gem install compass

于 2015-02-08T17:43:48.863 回答