Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Received error in console when attempting to run Sass on Macbook Pro

ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory

Run the following commands for me and tell me what they spit back out:

  • ruby -v Prints ruby version
  • rvm -v Prints RVM version
  • gem -v Prints RubyGems version
  • gem list Lists installed gems
  • sass -v Prints Sass version

I'm particularly interested in the second one.

Kimberlys-MacBook-Pro-2:~ Kim$ ruby -v ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13] Kimberlys-MacBook-Pro-2:~ Kim$ rvm -v -bash: rvm: command not found Kimberlys-MacBook-Pro-2:~ Kim$ gem -v 2.0.14 Kimberlys-MacBook-Pro-2:~ Kim$ gem list

*** LOCAL GEMS ***

bigdecimal (1.2.0) CFPropertyList (2.2.0) io-console (0.4.2) json (1.7.7) libxml-ruby (2.6.0) minitest (4.3.2) nokogiri (1.5.6) psych (2.0.0) rake (0.9.6) rdoc (4.0.0) sqlite3 (1.3.7) test-unit (2.0.0.0) Kimberlys-MacBook-Pro-2:~ Kim$ sass -v -bash: sass: command not found Kimberlys-MacBook-Pro-2:~ Kim$

3 Answers

Okay, for starters, install RVM. It stands for Ruby En*vironment **Manager. (Used to stand for **Ruby **Version **M*anager.) You can check out their website for a download.

RVM allows you to switch/upgrade Ruby versions easily. It also allows you to make gemsets, which are sets of gems that are tied to a particular version of Ruby. So, if different projects of yours use different gems, you can use gemsets to manage them. A true lifesaver.

So, what you want to do is either download RVM from the site above or run the following command:

\curl -sSL https://get.rvm.io | bash -s stable --ruby=2.1.2

It will install RVM, along with the latest version of Ruby. It'll take a little bit, so don't be worried.

After it finishes and you get your prompt back, install Sass by running gem install sass. Then try running sass -v.

I used the command, but it looks like it failed. Should I try downloading it from the website?

Kim,

Thank you for using RVM!

We sincerely hope that RVM helps to make your life easier and more enjoyable!!!

~Wayne, Michal & team.

In case of problems: http://rvm.io/help and https://twitter.com/rvm_io rvm 1.25.28 (stable) by Wayne E. Seguin wayneeseguin@gmail.com, Michal Papis mpapis@gmail.com [https://rvm.io/] Searching for binary rubies, this might take some time. Found remote file https://rvm.io/binaries/osx/10.9/x86_64/ruby-2.1.2.tar.bz2 Checking requirements for osx. About to install Homebrew, press Enter for default installation in /usr/local, type new path if you wish custom Homebrew installation (the path needs to be writable for user) : Requirements installation failed with status: 1. Kimberlys-MacBook-Pro-2:~ Kim$ Kimberlys-MacBook-Pro-2:~ Kim$ Kimberlys-MacBook-Pro-2:~ Kim$ gem install sass ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory. Kimberlys-MacBook-Pro-2:~ Kim$

Queer...mine's installed in my local library, but it's trying to install yours in the global library.

Hang on while I do some quick Googling around. Sorry about this!

That's cool. I really appreciate the help !

All right, try running \curl -sSL https://get.rvm.io | bash -s stable --ruby=2.1.2 --trace. It's probably going to fail, and that's all right. If it asks you to do something, just choose the default.

I don't know if you want me to copy and paste all of this....it was running for a while. Was that supposed to happen? At the top of the console window it flashed the words date and bash numerous times

:( Also, tried this again: Kimberlys-MacBook-Pro-2:~ Kim$ gem install sass ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory. Kimberlys-MacBook-Pro-2:~ Kim$

Just make a pastebin. Syntax highlighting Bash, expiration 1 day. Then link it here.

file exceeds 500 kilobytes

You'll have to put a link to it here; I can't seem to find it.

Sorry about all this hassle, by the way. I didn't think it'd take nearly this long.

does this work? http://pastebin.com/6bqUxCjK also named it: ConsoleErrorSass. I couldn't paste it all since it was too large. this is honestly a 1/16 of what is in the console.

Great! Can you try running rvm -v again?

Kimberlys-MacBook-Pro-2:~ Kim$ rvm -v -bash: rvm: command not found Kimberlys-MacBook-Pro-2:~ Kim$

All right, I think I might have it. Try

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

and then

\curl -sSL https://get.rvm.io | bash -s stable --ruby=2.1.2

and then

gem install sass

A forewarning: they will all take a decent amount of time to complete.

return to continue? Kimberlys-MacBook-Pro-2:~ Kim$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" ==> This script will install: /usr/local/bin/brew /usr/local/Library/... /usr/local/share/man/man1/brew.1

Press RETURN to continue or any other key to abort

Yes; hit return/enter.

Should I be running 'brew doctor' first of go ahead and enter gem install sass? ==> /usr/bin/sudo /bin/chmod g+rwx /usr/local ==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local ==> /usr/bin/sudo /bin/mkdir /Library/Caches/Homebrew ==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew ==> Downloading and installing Homebrew... remote: Counting objects: 194288, done. remote: Compressing objects: 100% (52718/52718), done. remote: Total 194288 (delta 140397), reused 194288 (delta 140397) Receiving objects: 100% (194288/194288), 39.74 MiB | 3.52 MiB/s, done. Resolving deltas: 100% (140397/140397), done. From https://github.com/Homebrew/homebrew

  • [new branch] master -> origin/master HEAD is now at a916da2 nvm 0.14.0 ==> Installation successful! ==> Next steps Run brew doctor before you install anything Run brew help to get started

Run brew doctor, then the other two commands:

\curl -sSL https://get.rvm.io | bash -s stable --ruby=2.1.2

gem install sass

so, i should run: 'source /Users/Kim/.rvm/scripts/rvm' before 'gem install sass' http://pastebin.com/4j2sVJbb

Yes.

well....so it worked and you rock, but why is it having trouble fetching the test.scss file I created on my desktop? Kimberlys-MacBook-Pro-2:~ Kim$ gem install sass Fetching: sass-3.4.1.gem (100%) Successfully installed sass-3.4.1 Parsing documentation for sass-3.4.1 Installing ri documentation for sass-3.4.1 Done installing documentation for sass after 3 seconds 1 gem installed Kimberlys-MacBook-Pro-2:~ Kim$ sass test.scss Errno::ENOENT: No such file or directory @ rb_sysopen - test.scss Use --trace for backtrace. Kimberlys-MacBook-Pro-2:~ Kim$

Thanks again for all of your help Ryan. You should get quadruple points for the new question! I'll open a new ticket for this.