71

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?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Sam Purcell
  • 815
  • 1
  • 6
  • 12
  • 29
    Fixed it! I needed to reinstall sass - I originally tried running `gem install sass` but I first needed to run `gem uninstall sass`. Simple error, and while I'm not sure of the cause, it seems to be dependency related. – Sam Purcell Jun 02 '13 at 04:22
  • 2
    Am having similar issues with 3.3.0.alpha builds. The stable standard sass version seems to resolve the issue.. – jfroom Jun 28 '13 at 20:41
  • Free free to format your fix as an answer and mark it answered - solutions found by the one who asked the question are just as useful to posterity and the public. – iono Jul 24 '13 at 02:35
  • @SamPurcell like you write in your comment, by reinstalling SASS i solved the same issue. Thanks. I think you should write an answer and accept it. – gontard Jan 07 '14 at 15:21

11 Answers11

113

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.

Mike Grace
  • 16,636
  • 8
  • 59
  • 79
  • i adore how something so simple can solve such problems...i've also got to give Google and SO props for this being the second option in the query results – beauXjames Jan 10 '14 at 17:39
  • 1
    This worked for me on OS X. I actually had 2 sass versions on my computer, and perhaps that's why it wasn't working for me. When I uninstalled, I uninstalled both versions, then just did 'gem install sass', then compass worked. – Chris Livdahl Jan 12 '14 at 08:51
  • This is amazing in a strictly negative way. (the shape of the solution, not your work, Mike) – Parham Jan 20 '14 at 20:51
  • This is silly - shouldn't sass be included with compass? – Nick Coad Feb 05 '14 at 08:46
  • I had two versions installed, which I both removed. Installing again worked! – TTT Feb 10 '14 at 11:12
  • Re-installing sass didn't work for me, re-installing compass did. Looks like compass installs its own sass gem. – Vince C May 14 '14 at 07:32
  • 5
    I had to do **gem uninstall compass** and **gem install compass** , then it worked! – Asaf May 16 '14 at 20:43
  • I also had to run `rm Gemfile.lock` and then rebundled – bcackerman Jul 06 '14 at 15:58
  • This did not work for me as it installed the latest sass, not the one I needed for Compass to work with. This command actually caused my original issues ;) – Nick Sep 02 '14 at 06:32
  • This is a copy of the self-answer given by the OP seven months earlier. Though the OP posted it as a comment — the very first comment to the question, in plain view — instead of an answer, the right thing to do, rather than repost the answer as one's own, would have been to post a community wiki answer and [this is what I have now done](http://stackoverflow.com/a/26951515/119775). – Jean-François Corbett Nov 15 '14 at 22:37
24

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
    
Nicolas Janel
  • 3,025
  • 1
  • 28
  • 31
13

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}
Volker Rose
  • 1,808
  • 15
  • 16
  • THANK YOU. That took forever. The combination of sass 3.3.0.alpha.149 and compass 0.12.2 did the trick. – TaylorMac Feb 19 '14 at 00:55
  • Checkout RubyGems to find out the exact dependencies for your version of compass - https://rubygems.org/gems/compass. See my post further down for info on how to do version ranges in gemfiles. – Nick Sep 02 '14 at 06:33
10

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).

Jürgen Paul
  • 14,299
  • 26
  • 93
  • 133
  • 1
    I was struggling with this, also, trying to get SASS Source Maps to work. https://github.com/chriseppstein/compass/issues/1339 targets this. – Volker Rose Jul 24 '13 at 09:16
4

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.

raam86
  • 6,785
  • 2
  • 31
  • 46
3

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.

Nick F
  • 9,781
  • 7
  • 75
  • 90
  • 1
    Fixed it for me! (didn't realize bootstrap-sass was a ruby thing) thought it was a npm package or something else that I had already installed. – Cory Danielson Jun 17 '14 at 22:39
3

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.

random-forest-cat
  • 33,652
  • 11
  • 120
  • 99
2

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.

ice.nicer
  • 1,644
  • 14
  • 13
1

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.

Community
  • 1
  • 1
psergiocf
  • 1,493
  • 2
  • 20
  • 27
0

The following combinations worked for me:

gem install compass --pre
gem install sass -v 3.3.3
ATSiem
  • 1,194
  • 12
  • 19
0

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"
Nick
  • 2,803
  • 1
  • 39
  • 59