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 trialRichard Nash
24,862 PointsRuby update installation issue and question...
I'm trying to update ruby on my mac just like Guil Hernandez suggests in the video and I get the following error:
Last login: Thu Oct 16 23:19:19 on console
rn-3:~ richardnash$ gem update --system
Updating rubygems-update
Fetching: rubygems-update-2.4.2.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
rn-3:~ richardnash$
Gil suggests to use sudo to become a super user temporarily, which works, or course, but I would prefer to simply have total control over my computer all the time so I do not have to deal with using sudo ever again.
So how do I become the master of my own computer?
2 Answers
Ryan Duchene
Courses Plus Student 46,022 PointsRuby and a set of default gems come bundled with all Macs. They are installed for all users, so it's hard for anyone but root to change them.
You'll need to install rvm, and then use rvm to install a version of Ruby. rvm will allow you to have multiple versions of Ruby installed at once (and switch between them at ease). It will also allow you to maintain dependency sets for each project of yours with gemsets.
So, once you install rvm, run rvm install ruby-head
, and then gem install compass
, and you should be good to go.
If you run into sudo
issues with Homebrew, just use sudo
. Homebrew only requires it for installation IIRC, not for continued use.
James Barnett
39,199 Pointsbut I would prefer to simply have total control over my computer all the time so I do not have to deal with using sudo ever again.
I like how this server fault answer puts it:
Most everyday tasks don't require a root shell. So it is good practice to use an unprivileged shell as your default behaviour and then only elevate to root when you need to perform special tasks.
By doing so you are reducing scope for dangerous mistakes (bad scripting, misplaced wildcards, etc) and vulnerabilities from any applications that you use.
For more details check out the Treehouse video on sudo in the Console Foundations course.