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

Ruby

Cindy L Francies
Cindy L Francies
13,318 Points

Problem installing rails on mac

Hi all. Almost done setting up rails on mac. Got to installing rails and I got: ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

It's myhome workstation.. I definitely have permissions.. I am the only user. I'm on Yosemite 10.10.5 Any help appreciated! thanks

5 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hey Cindy,

Even though it's your home system, you probably don't have the user permission required to do the install. It's kind of like installing from a disk image, where you need to enter your admin password.

Try prefixing the install command with sudo (this is telling the console that you are the "Super user". It will ask you for your password (this will be your admin password for you system). You probably won't see anything being typed (this is normal), but it is there.

This should solve that error. :) :dizzy:

Cindy L Francies
Cindy L Francies
13,318 Points

well, I had some concerns on doing this because of some threads on stack_overflow but I took a gamble. Here's how far I got. What's next? ''' sudo gem install rails --version 5.0.0 Password: Fetching: i18n-0.7.0.gem (100%) Successfully installed i18n-0.7.0 Fetching: thread_safe-0.3.5.gem (100%) Successfully installed thread_safe-0.3.5 Fetching: tzinfo-1.2.2.gem (100%) Successfully installed tzinfo-1.2.2 Fetching: minitest-5.9.0.gem (100%) Successfully installed minitest-5.9.0 Fetching: concurrent-ruby-1.0.2.gem (100%) Successfully installed concurrent-ruby-1.0.2 Fetching: activesupport-5.0.0.gem (100%) ERROR: Error installing rails: activesupport requires Ruby version >= 2.2.2. '''

Jason Anders
Jason Anders
Treehouse Moderator 145,858 Points

I didn't realize your were doing the Rails 5 Course. Though I'm not 100% sure, it looks like you need to upgrade your Ruby to the needed version.

Try upgrading your Ruby to 2.2.2. There are instructions here (scroll to the bottom and sub the 2.1.1 with 2.2.2). Then try the Rails install again.

Tagging Jay McGavren for assistance and verification. :dizzy:

Jay McGavren
STAFF
Jay McGavren
Treehouse Teacher

Jason Anders , yeah, we're generally trying to encourage students to use RVM so that they have an easier time installing and managing their gems, and don't have issues with things like sudo.

Cindy L Francies , were you following the directions in our installation workshop? If not, I would recommend using those; it'll give you a solid, upgradeable Ruby and Rails install, and we'll have an easier time helping you troubleshoot.

Cindy L Francies
Cindy L Francies
13,318 Points

Yeah, I followed the video. Just didn't work. I wanted to hold out and not do the SUDO because it was recommended to not do that on Stack Overflow.. perhaps you can comment ? (I did eventually relent and do it.. seems to be ok now.)

Jay McGavren
STAFF
Jay McGavren
Treehouse Teacher

Cindy L Francies on what step of the installation workshop did it fail? Can you reattempt the step(s), and copy and paste the output?

Cindy L Francies
Cindy L Francies
13,318 Points

I believe it is working now.. at least installed correctly. the errors were what I mentioned above:

  1. ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
  2. When i did the SUDO suggestion it got to the point where it failed because I didn't have Ruby 2.2.2- which I installed per above. Thanks