如何在mac中安装指南针?

时间:2013-06-10 14:18:35

标签: terminal sass compass-sass

我想通过mac中的终端安装指南针。我安装了sass。我现在有Sass 3.3.0.alpha.175(Bleeding Edge)

然后我尝试安装罗盘     sudo gem安装指南针 它给了我这个警告

/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作为编辑器)。但我也想在那里添加指南针

有没有办法让这个工作 - 我使用os版本10.8.3

由于

3 个答案:

答案 0 :(得分:22)

指南针与sass 3.3.0 alpha不兼容(请参阅gem doc)。您应该卸载指南针和sass,并使用sudo gem install compass重新安装,这将安装sass(使用正确的版本)。

编辑:

今天(2017年2月26日)刚尝试用rvm安装罗盘,偶然发现了另一个错误:Error compiling Compass LoadError on line [“179”] .. data.rb: Cannot load such fileThis answer为我工作。

答案 1 :(得分:8)

对于它的价值,如果您使用的是RVM,那么请不要使用sudo。以下是我解决这个问题的方法(我使用Alexandre的答案来到这里):

1)$ gem uninstall sass (说是提示提醒您有关依赖性的信息,无论如何都要重新安装)

2)$ gem install sass -v 3.2.10

之后,罗盘工作得很好

答案 2 :(得分:3)

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