3

I've been trying to install Sass on Gentoo, but it hasn't been going too well. Unfortunately, the latest version of Sass in portage is 3.1.21. What I want to use Sass for requires at least Sass 3.2, which is available through rubygems.

What I've tried:

  • emerge dev-ruby/sass (installs an old version)
  • gem install sass

The second command appears to install the Sass gem. However, I do not use Rails or Ruby in any other aspect apart from Sass, so the gem appears useless to me. In addition, I do not know where gems are installed to or how to use them (I'm a ruby noob.) All I want to do is call sass from the command line.

Are there any ways to obtain an up-to-date version of Sass which I can just use from the command line?

Cheers.

q3d
  • 3,473
  • 8
  • 34
  • 39

5 Answers5

6

On Gentoo, user-installed gems are not in your PATH by default. I have created a bug report because while user-installed gems work much better than they used to, this problem really needs to be rectified. You can help by voicing your opinion in the report and linking back to this page. To get things working, you can either deploy the script I uploaded to the report or use RVM instead, which will give you much more consistent behaviour across distros.

Chewi
  • 530
  • 3
  • 4
1

I'm wondering but all the answers looks weird for me. One of the biggest gentoo advantage is ebuild writing which is easy as pie so every user can contribute whatever he needs.

  • Add local overlay
  • fork upstream ebuild to your local overlay
  • bump version
  • use
  • test
  • attach tested ebuild to bug report, maybe also contact someone on #gentoo-dev-help

Trust me, using gem (or cabal, or whatever) instead of your package manager if way to mess your system.

cnd
  • 32,616
  • 62
  • 183
  • 313
1

Some might find useful to know that under Gentoo you can install sass using emerge which will solve the PATH problem some people are encountering.

# emerge -av sass

after which you should be able to use sass without problem. Another solution would be to use rvm which could make things more portable and uniform across environments.

edit: in case someone's asking: to install rvm just follow the instructions found at: https://rvm.io/rvm/install/ and install the stable version.

Mr Peach
  • 1,364
  • 1
  • 12
  • 20
0

Consider using compass it will accepts command lines like: compass [YOUR-FILE].sass and can also compass watch [SASS FOLDER] and 'compile' css to it.

http://compass-style.org/

To install using a gem

 gem update --system
 gem install compass

Installation

raam86
  • 6,785
  • 2
  • 31
  • 46
  • This uses a gem; and I don't know where those install to (I've tried googling this, but with no results. People only seem to use gems in RoR projects instead of standalone from the command line :( ) – q3d Nov 11 '12 at 17:14
  • The only way to install Compass is through rubygems, which I don't know how to use :\ – q3d Nov 11 '12 at 17:23
  • Works on any computer which has ruby installed. Just install it the same way you did with sass gem and use compass watch --folder-- – raam86 Nov 11 '12 at 19:17
0

I don't see a down side to using the gem version of Sass. I'm also not a Ruby/RoR developer (I use Haskell/PHP), and I just use the gem. I know just enough about gems to install/uninstall them, and that seems good enough for using Sass.

Installing and upgrading Sass is done with the same command:

sudo gem install sass

Installing Sass via gems gives you the ability to use it via command line, just like it shows on the official website: http://sass-lang.com/.

sass --watch style.scss:style.css

Other command line options can be found via --help or on their docs: http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#using_sass

sass --help
cimmanon
  • 67,211
  • 17
  • 165
  • 171
  • Unfortunately, after doing `gem install sass`, I get `bash: sass: command not found` when I try to run it :\ – q3d Nov 11 '12 at 19:21
  • Try auto-completing the sass command? My commands are actually postfixed with "19" (`sass19`, `gem19`). I'm told it has something to do with the Ruby version (1.9) I am running. – cimmanon Nov 11 '12 at 20:04
  • Closed all of your terminals and then started fresh connections? I don't think you need to fully reboot, but it's worth a shot if nothing else works. – cimmanon Nov 11 '12 at 20:31
  • Tried rebooting and then trying from other user accounts too; got nothing. – q3d Nov 11 '12 at 21:19