Can't use compass after installing it

Ilyes512 picture Ilyes512 · Jan 12, 2014 · Viewed 22.6k times · Source

I don't seem to be able to get compass working on Vagrant using this Vagrantfile. See the rest of the bash script's used right here(removed repo) (see Vaprobash if you want to provision your Vagrant Ubuntu Box!).

So I was fallowing a gruntjs course, when I had to use grunt server. The only problem is that it needs a newer ruby version (1.9+ I believe instead of the 1.8) and it needs compass. So I have solved the ruby part by installing RVM and installing the latest stable version. Compass should be easy to get gem install compass and it does seem to be installed. But when I type in compass -v I get the fallowing error:

/home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- sass/script/node (LoadError)
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in `<top (required)>'
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:in `block in <top (required)>'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `each'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `<top (required)>'
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in `<top (required)>'
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:5:in `block in <top (required)>'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:4:in `each'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/lib/compass.rb:4:in `<top (required)>'
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:20:in `block in <top (required)>'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:8:in `fallback_load_path'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/gems/compass-0.12.2/bin/compass:19:in `<top (required)>'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/compass:23:in `load'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/compass:23:in `<main>'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
    from /home/vagrant/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'

So I am not sure what is going wrong except for the error telling me it's missing files. Anyone got some hints to what could be the problem?

.bash_profile contains the path info:

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

rvm -v and ruby -v work just fine and after installing gem install compass sass -v seem to work as well.

You can replicate everything using Vagrant and VirtualBox. Just download the Vagrantfile from my github mentioned above and vagrant up.

Answer

Ilyes512 picture Ilyes512 · Jan 14, 2014

I asked for help on the official compass Github issue's page and got the answer for this problem.

The GitHub issue is right here.

How to fix this:

When installing compass (v0.12.2), it will download the latest sass v3.3.0.rc3 (cause it's a dependency), but compass won't work with the latest sass. You either upgrade compass to the latest alpha version (0.13.*) or downgrade sass to 3.2.*. I choose the last one:

gem uninstall sass --version 3.3.0.rc.3
gem install sass --version 3.2.18
compass -v # Working :)

Make sure you use the version you got installed. Find out by typing this:

sass --version