This is really stupid but I've been Googling for an hour now and can't find the answer.
I'm on Ubuntu 10.10, and I'm trying to update to the latest version of SASS so that I can use an @import rule inside an @media rule.
$ sudo gem install sass --pre
And that seemed to work fine:
Successfully installed sass-3.2.0.alpha.35 1 gem installed But when I try $ sass -v I get: Haml/Sass 3.0.9 (Classy Cassidy) which is the old version I had before updating.
What am I doing wrong?
$ which gem /usr/bin/gem $ which sass /usr/bin/sass Tried the answer:
$ sass -v Haml/Sass 3.0.9 (Classy Cassidy) $ sudo gem uninstall -Iax sass Removing sass Removing sass-convert Removing scss Successfully uninstalled sass-3.2.0.alpha.35 $ sass -v Haml/Sass 3.0.9 (Classy Cassidy) (Was expecting an error here) $ sudo gem install sass --pre Successfully installed sass-3.2.0.alpha.35 1 gem installed Installing ri documentation for sass-3.2.0.alpha.35... Installing RDoc documentation for sass-3.2.0.alpha.35... $ sass -v Haml/Sass 3.0.9 (Classy Cassidy) So it removes the one I successfully installed and leaves the one that actually gets used when I run the sass command. Thougts?
3 Answers
What we ended up doing was the following:
First, we installed rvm using the rails ready one-liner:
wget --no-check-certificate && bash railsready.sh
Selecting option 2 (RVM) when asked.
Then, we did source ~/.bashrc
Then we did a gem install sass --pre (no sudo).
Remove it and then reinstall:
sudo gem uninstall -Iax sass sudo gem install sass --pre New Edit: I've just seen that you might have been using the haml-edge gem (which packs its own copy of sass). Nuke that and install sass-proper.
sudo gem uninstall -Iax haml-edge sudo gem install sass --pre Boom.
Old Edit if you've still got stuff left over it sounds like there's been a manual install, another gem has set something up or you've installed it from a package. I'd be tempted to tell you to nuke it from orbit and fix it later.
Run nano $(which sass) and see what you're dealing with. In my gem-installed version I see a header like:
#!/usr/bin/ruby1.8 # # This file was generated by RubyGems. # # The application 'sass' is installed as part of a gem, and # this file is here to facilitate running it. If you see something similar, that suggests there's something fishy and I vote you just run:
sudo rm "$(which sass)" "$(which sass-convert)" "$(which scss)" If there's a different header in there, it might give you a clue where it came from. If it's a package you've installed, remove it. If you can't (eg it's a dependency) you could nuke the file and replace accordingly (knowing that it might break the dependency anyway).
But at the end of the day, it's only a Ruby gem. Killing it isn't going to cancel Christmas.
1I've tested this on Linux Mint 14 (Nadia), i.e. Ubuntu 12.10 (Quantal).
1. Check your environnement
First check you current version of sass
sass --version # Sass 3.1.19 (Brainy Betty) which sass # /usr/bin/sass 2. Remove distro packages
remove packages installed with the packages manager (i.e apt-get or apitude) as they take priority
apt-get remove ruby-sass ruby-compass Note: this can be skipped if you configure your $PATH to target the right binary (see below).
3. Install new version
apt-get install ruby-full gem install sass gem install compass 4. Test version
sass --version # Sass 3.2.7 (Media Mark) which sass # /usr/local/bin/sass