Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 962
stedekay Avatar asked Apr 09 '13 09:04

stedekay


4 Answers

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
like image 112
Jon Cairns Avatar answered Nov 09 '22 21:11

Jon Cairns


This simple command works on ubuntu 14.10

sudo apt-get install ruby-compass
like image 25
Vivien Avatar answered Nov 09 '22 22:11

Vivien


RVM is awesome and really easy to install. I managed to install rvm, compass, and sass with these commands in my terminal:

Firstly:

curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enabled --ruby=1.9.3

This will instal rvm, it will put a command in ~/.bash_profile to load rvm automatically, except this isn't what Ubuntu uses so put this line into your ~/.bashrc file:

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

Then simply run:

gem install compass
gem install susy #(or sass)
like image 23
masterchief Avatar answered Nov 09 '22 21:11

masterchief


Install build-essentials and ruby-dev packages to install compass without errors.

sudo apt-get install build-essential
sudo apt-get install ruby
sudo apt-get install ruby-dev
sudo gem install compass
like image 29
Murali Krishna Avatar answered Nov 09 '22 21:11

Murali Krishna