Ruby Environment Setup for Beginners – OSX
I’m very excited to be working on my very first OSX machine ever. Do I love Apple business practices? No. Do I like their hardware? Hell yeah.
So, onto setting up a Ruby Environment! This guide is a great way to get started, and definitely helped me get started.
1. Open Terminal
2.Install xcode (see my previous Python setup post for how to do this)
3. Install homebrew. the missing package manager for OSX (see Python setup post for this as well)
4. Install RVM (Ruby Version Manager).
echo "gem: --no-document" >> ~/.gemrc
- WHY? This is the configuration that allows you to install gems without automatically installing huge amounts of offline documentation
curl -L https://get.rvm.io | bash -s stable --auto-dotfiles --autolibs=enable --rails
- This is where bash stuff gets a little more complex!
curlis a program that makes web requests and returns the result
-Lmeans we’re logging the result of the get request (sent by curl to the get.rvm.io address) to the console
|is the pipe. what we’re saying pass the stuff at the left of the pipe that is logged to the console to whatever is in the right of the pipe
--railsat the end tells the rvm script to install the latest version of rails
- Essentially, we’re downloading the rvm install script (which handles ruby installation for you) using
curland running it using
5. Once that’s done (you’ll see a stream of “successfully installed…”) close out of Terminal and reopen it.
6. Type in
rvm and you’ll see a bunch of joyously green text which confirms that rvm is installed – yay!
7. Type in ‘rails -v’ to verify your rails version, or ‘ruby -v’ to verify your ruby version
AND WE’RE DONE!