为什么“指南针监视”说它无法加载sass / script / node(LoadError)?

时间:2013-06-01 20:36:59

标签: ruby rubygems compass-sass

我的指南针监视命令出了问题 - 它在几天前工作正常。我没有对配置文件进行任何更改。

我重新安装了Compass,使用rvm更新Ruby。我检查了我的custom_require.rb文件,但我真的不知道该找什么。它似乎试图在某处加载文件“sass / script / node”并从http://sass-lang.com/docs/yardoc/Sass/Script/Node.html我收集文件路径 - 但我什么都没有。

/Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require': cannot load such file -- sass/script/node (LoadError)
  from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
  from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
  from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in `<top (required)>'
  from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
  from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
  from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:in `block in <top (required)>'
  from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `each'
  from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `<top (required)>'
  from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
  from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
  from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in `<top (required)>'
  from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
  from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
  from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass.rb:5:in `block in <top (required)>'
  from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass.rb:4:in `each'
  from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/lib/compass.rb:4:in `<top (required)>'
  from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
  from /Users/sampurcell/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
  from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/bin/compass:20:in `block in <top (required)>'
  from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/bin/compass:8:in `fallback_load_path'
  from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/gems/compass-0.12.2/bin/compass:19:in `<top (required)>'
  from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/bin/compass:19:in `load'
  from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/bin/compass:19:in `<main>'
  from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
  from /Users/sampurcell/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'

有人有什么想法吗?

11 个答案:

答案 0 :(得分:112)

卸载sass并使用以下命令重新安装:

gem uninstall sass
gem install sass

我的sass安装存在问题,这样做解决了这个问题。

答案 1 :(得分:24)

在我的情况下,Sass版本与Compass不兼容。

FIX:

  1. 卸载Sass AND Compass

    gem uninstall compass
    gem uninstall sass
    
  2. 安装Compass 谁将自动安装兼容的Sass引擎

    gem install compass
    

答案 2 :(得分:13)

这个组合终于让我把Compass和SASS Sourcemaps结合在一起了:

的Gemfile

gem 'sass', '3.3.0.alpha.149'
gem 'compass', '0.12.2'
gem 'compass-sourcemaps', "~> 0.12.2.sourcemaps.57a186c"

指南针config.rb

sass_options = {:sourcemap => true}

答案 3 :(得分:10)

此特定版本适用于两者:

gem 'sass', '3.3.0.alpha.149'
gem 'compass', '0.12.2'

它们可能彼此不兼容,这就是为什么你会收到这些错误(考虑到你使用的是最新版本)。

答案 4 :(得分:4)

如果您使用的是Ubuntu,可能是apt-get和rvm发生冲突的问题。

尝试使用rvm implode删除rvm 然后运行

sudo apt-get install ruby-compass 
之后

compass watch为我工作。

答案 5 :(得分:3)

以上答案的变体:对我来说(使用Bootstrap for Sass),结果是

gem install bootstrap-sass

是解决此问题所必需的。对我来说,在我更新了我正在使用的Ruby版本之后,Compass的LoadError问题就开始了。

答案 6 :(得分:3)

我认为这是因为与sass的版本冲突。

https://rubygems.org/gems/compass gem当前位于v0.12.16 - 将其添加到Gemfile

gem 'sass', '3.2.19'
gem 'compass', '0.12.6'

您可能需要先卸载这两个宝石的所有版本。

答案 7 :(得分:2)

我能够通过这样做来解决这个问题

gem uninstall sass
gem install sass -v 3.2.12

这肯定是由于版本依赖性问题,你最好修复你的grunt任务,使其与更新版本的saas,指南针等向前兼容。

答案 8 :(得分:1)

我有同样的问题然后我意识到我有两个指南针版本,所以通过这样做:

compass watchcompass compile

编译器不知道应该使用哪个罗盘版本进行编译。因此,您可以做的是明确指出要使用的罗盘版本:

compass _1.0.3_ watch

另一个有趣的thread

答案 9 :(得分:0)

以下组合对我有用:

gem install compass --pre
gem install sass -v 3.3.3

答案 10 :(得分:0)

我必须使用正确的版本设置一个gemfile(这个错误是由不匹配的SASS和Compass版本引起的,对我而言)。我使用了以下bundle install来解决问题:

source "https://rubygems.org"

gem 'bootstrap-sass', "~> 3.2.0"
gem 'sass', [ "< 3.5" , ">= 3.3.13" ]
gem 'compass', "~> 1.0.1"
gem 'compass-core', "~> 1.0.1"
gem 'compass-import-once', "~> 1.0.5"
gem 'chunky_png', "~> 1.2"
gem 'rb-fsevent', ">= 0.9.3"
gem 'rb-inotify', ">= 0.9"