stedekay stedekay - 1 month ago 7x
Ruby Question

Installing Compass & Susy on Ubuntu 12.04

I'm trying to install Compass and Susy on my Ubuntu 12.04.

What I have tried are the following steps on the console:

sudo apt-get install rubygems1.8
sudo gem install rubygems-update # Instead of sudo gem update --system
sudo update_rubygems
sudo gem install compass # Installing Compass & Sass
sudo gem install susy

So the gems are installed and will be listed when I do the following command:

gem list

But now, when I try to create a new compass project with

compass create project

I get the following error:

/usr/local/bin/compass: /usr/bin/ruby1.9.1: bad interpreter: No such file or directory

My current ruby version is 1.8.7. So I installed ruby 1.9.1 and get it working.
The console still says the current ruby version is 1.8.7

My question: Do I have to run with both ruby versions to get that working? Is there another way under ubuntu? It's working, I know, but it's a bit confusing.


Using Ubuntu's package manager for multiple ruby versions is a bit of a lost cause.

Most people use rvm, which allows you to install and switch between multiple rubies very easily.

Other popular options are rbenv and chruby. It's just a question of personal preference, but I'd say that rvm has the slight edge for beginners.

Also, I wouldn't recommend installing ruby 1.9.1 - it's best to use 1.9.3 as there are some compatibility issues with other 1.9.x versions.

You can then install compass and sass via ruby gems (rather than aptitude):

$ gem install compass
$ gem install sass