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

Development Tools Installing a Ruby Development Environment Installing a Ruby Development Environment Installing Ruby on Mac

Daniel Wise
Daniel Wise
9,119 Points

Can't Install Ruby to my Mac

I keep getting this message when ever I run this code: Last login: Wed Jul 22 21:26:04 on ttys000 Daniels-MacBook-Air:~ daniel$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv fatal: destination path '/Users/daniel/.rbenv' already exists and is not an empty directory. Daniels-MacBook-Air:~ daniel$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile Daniels-MacBook-Air:~ daniel$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile Daniels-MacBook-Air:~ daniel$ $ruby -v -bash: -v: command not found Daniels-MacBook-Air:~ daniel$

I copied the code so you can take a look

2 Answers

Josh Cummings
Josh Cummings
16,310 Points

This is how I got mine installed:

1 - Run all the updates! Seriously. If your system is completely up to date, you're almost there because Mac OS X includes Ruby. However, you should NOT use this version (more on that here).

2 - Install the latest version of Xcode from the Mac App Store. Xcode is Apple’s IDE for developing on the Mac. You need Xcode because your Mac doesn’t come pre-installed with developer tools and commands like “make”.

3 - Install the latest version of Homebrew. Homebrew is an awesome command line tool that lets you easily install lots of really cool stuff on your Mac via Terminal. You can use this command in Terminal to install it.

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

4 - Install RVM (Ruby Version Manager). This helps you easily install and manage Ruby. You can use this command in Terminal to install it.

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

5 - See what the latest version of Ruby is by visiting the Ruby website. Currently, the latest version is 2.2.2.

6 - Use RVM to install Ruby 2.2.2 by typing the following command into Terminal.

rvm install 2.2.2

7 - Grab a beer while you watch RVM and Homebrew get to work! Homebrew even puts a little beer Emoji in the command line to remind you to do this.

8 - Once Ruby 2.2.2 is installed, it will prompt you to download the Ruby documentation by typing in the following command.

rvm docs generate-ri

9 - Check to see that Ruby 2.2.2 is installed by typing the following command into Terminal.

ruby -v

10 - Get ready to party with Ruby!

Helpful links:

http://brew.sh

https://rvm.io/rvm/install

https://www.ruby-lang.org/en/downloads/

https://rvm.io/rvm/install

Daniel Wise
Daniel Wise
9,119 Points

Thank you so much for your help! I finally got it running