1

I want to install the compass html5 boilerplate gem. When I try to install it I get the following error.

$ sudo gem install html5-boilerplate ERROR: Error installing html5-boilerplate: compass-h5bp requires Ruby version ~> 2.0. 

Then when I check my ruby version it says:

$ ruby -v ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux] 

But I used RVM before so I thought I could just change version but when I check it says I'm using ruby-2.2.0 already.

$ rvm list rvm rubies =* ruby-2.2.0 [ x86_64 ] # => - current # =* - current && default # * - default 

I think I must be missing something obhvious, it's been a while since I've worked with Ruby and RVM.

Update 1

I ran the below commands as suggested by @tadman and it does seem the wrong path is being used.

~:$ cd ~/.rvm/bin bin:$ ls ruby-rvm-env rvm rvm-auto-ruby rvm-exec rvm-prompt rvm-shebang-ruby rvm-shell rvm-smile rvmsudo bin:$ which ruby /usr/bin/ruby 

UPDATE 2

After correcting the path in my .bash_profile the ruby version seems correct but I'm still getting the same error when trying to install the html5-boilerplate gem??

$ sudo gem install html5-boilerplate ERROR: Error installing html5-boilerplate: compass-h5bp requires Ruby version ~> 2.0. $ ruby -v ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux] $ rvm list rvm rubies =* ruby-2.2.0 [ x86_64 ] # => - current # =* - current && default # * - default $ compass -v Compass 1.0.3 (Polaris) Copyright (c) 2008-2015 Chris Eppstein Released under the MIT License. Compass is charityware. Please make a tax deductable donation for a worthy cause: http://umdf.org/compass 

Also i have the compass gem installed on both Ruby 1.9.1 and RVM's ruby 2.2.0. Could this have something to do with it?

$ pwd /var/lib/gems/1.9.1/gems/compass-1.0.3 $ cd /home/ross/.rvm/gems/ruby-2.2.0/gems/compass-1.0.3 $ pwd /home/ross/.rvm/gems/ruby-2.2.0/gems/compass-1.0.3 

Is there a way to check which ruby version compass is using?

1 Answer 1

1

Having RVM and having RVM installed correctly are two different things. The most common cause of a mismatch like this is that your system Ruby has priority in your PATH.

In a POSIX shell, which ruby will tell you which one is getting executed. It is probably the wrong one.

RVM does its magic by manipulating which Ruby shows up in the RVM bin path, often ~/.rvm/bin or something similar. To get it to work correctly you'll need to ensure that path is first in your $PATH.

You may want to try reinstalling the RVM stub, or check that it's correctly loaded into your environment.

Sign up to request clarification or add additional context in comments.

4 Comments

It does seem to be using the wrong path. See my update in the question. How can I fix this?
Make sure rvm.sh is properly imported into your environment. It may be missing or skipped for some reason. Normally you'll see source rvm.sh somewhere in ~/.bashrc or ~/.profile or something equivalent.
thanks. That seemed to fix rvm, the correct ruby version is now showing but I still get the same error when I try to install html5-boilerplate gem? I updated my question again.
Have you tried not using sudo to install the Gem? Using sudo installs the gem to the ruby version for the super user, or root user on a system. This is not necessary with RVM. Just gem install html5-boilerplate should work.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.