Why does "compass watch" say it cannot load sass/script/node (LoadError)?

RubyRubygemsCompass Sass

Ruby Problem Overview


I'm having a problem with my compass watch command - it worked fine up until a few days ago. I have made no changes to my config files.

I reinstalled Compass, used rvm to update Ruby. I checked my custom_require.rb file but I really don't know what to look for. It seems to be trying to load the file "sass/script/node" somewhere and from http://sass-lang.com/docs/yardoc/Sass/Script/Node.html I gather the filepath - but I have nothing there.

/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>'

Anyone have any ideas?

Ruby Solutions


Solution 1 - Ruby

Uninstall sass and reinstall it with the following:

gem uninstall sass
gem install sass

There was an issue with my installation of sass and doing this fixed the issue.

Solution 2 - Ruby

In my case, Sass version was not compatible with Compass.

FIX :

  1. uninstall Sass AND Compass

    gem uninstall compass
    gem uninstall sass
    
  2. install Compass who will install a compatible Sass engine automaticaly

    gem install compass
    

Solution 3 - Ruby

This combination is finally working for me to bring Compass and SASS Sourcemaps together:

Gemfile

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

Compass config.rb

sass_options = {:sourcemap => true}

Solution 4 - Ruby

This specific version works well on both:

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

They might not be compatible with each other that's why you're getting those errors (considering you're using a bleeding edge version).

Solution 5 - Ruby

In case you are using Ubuntu it may be a problem with apt-get and rvm colliding.

Try removing rvm with rvm implode and then run

sudo apt-get install ruby-compass 

compass watch worked for me after that.

Solution 6 - Ruby

A variation on the above answers: for me (using Bootstrap for Sass), it turned out to be

gem install bootstrap-sass

that was needed in order to fix this problem. For me, the LoadError problem with Compass started after I updated the version of Ruby I was using.

Solution 7 - Ruby

I believe this is due to versioning conflicts with sass.

https://rubygems.org/gems/compass gem is currently at v0.12.16 currently - add this to Gemfile

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

You may be required to uninstall all versions of both gems first.

Solution 8 - Ruby

I was able to fix it by doing this

gem uninstall sass
gem install sass -v 3.2.12

This is definitely due to a version dependency issue, you are better off fixing your grunt task to make it forward compatible with the newer versions of saas, compass and so on.

Solution 9 - Ruby

I had the same problem and then I realised that I had two compass versions, so by doing:

compass watch or compass compile

The compiler didn't know which compass version it should use to compile. So, what you can do is explicitly indicate the compass version to work with:

compass _1.0.3_ watch

There's another interesting thread.

Solution 10 - Ruby

The following combinations worked for me:

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

Solution 11 - Ruby

I had to setup a gemfile with the correct versions (this error is caused by mismatched SASS and Compass versions, for me). I used thew following with bundle install to fix the problem:

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"

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSam PurcellView Question on Stackoverflow
Solution 1 - RubyMike GraceView Answer on Stackoverflow
Solution 2 - RubyNicolas JanelView Answer on Stackoverflow
Solution 3 - RubyVolker RoseView Answer on Stackoverflow
Solution 4 - RubyJürgen PaulView Answer on Stackoverflow
Solution 5 - Rubyraam86View Answer on Stackoverflow
Solution 6 - RubyNick FView Answer on Stackoverflow
Solution 7 - Rubylfender6445View Answer on Stackoverflow
Solution 8 - Rubyice.nicerView Answer on Stackoverflow
Solution 9 - RubypsergiocfView Answer on Stackoverflow
Solution 10 - RubyATSiemView Answer on Stackoverflow
Solution 11 - RubyNickView Answer on Stackoverflow