Skip to content

Instantly share code, notes, and snippets.

@kierangraham
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kierangraham/8804188 to your computer and use it in GitHub Desktop.
Save kierangraham/8804188 to your computer and use it in GitHub Desktop.
Companion notes for my Ruby on Ales Belfast Ruby talk on an Introduction to Ruby.

Belfast Ruby Notes - 4th Feb 2014

Companion notes for my 'Ruby on Ales' Belfast Ruby talk on an Introduction to Ruby. Slides are available on Speakerdeck.

Installing Ruby

One of the first and most important things to setup is a good text editor which you are comfortable using and will play nicely with Ruby projects. I'd recommend having a look at (and using) Sublime Text. It's an amazing editor, blazing fast, supports a huge amount of different languages and also has Mac, Windows and Linux support.

Mac (and Linux-ish)

These instructions are focused on installing Ruby on a Mac but some steps will also apply to a Linux machine, although depending on what distro you're using may vary.

iTerm 2 (Mac Only)

iTerm 2 is a replacement for the Terminal.app which ships with OS X. It's a big improvement over Terminal.app and allows you to better organise your workflow by being able to use both tabs and split panes, this means you can focus on your project instead of how many Terminal windows you have open, and where they are.

Get Homebrew (Mac only)

Homebrew is an open source package manager for Mac written in Ruby. It allows you to install common open source software and libraries with minimal fuss. For example, if you need a database installed on your machine you can get one with brew install mysql or brew install postgresql. Or if you want to use Git for source control you can install it with brew install git.

Install Homebrew

Run this in your terminal:

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

Get RVM (Mac + Linux)

Ruby Version Manager allows you to have multiple versions of Ruby installed on your machine and lets you easily switch between them, it can be useful if you have many Ruby projects that use a particular version of Ruby, each with their own specific set of Gems.

Mac OS X comes preinstalled with Ruby, however, unless you are running Mavericks it will be an older version of Ruby. Managing Rubies with RVM allows you to avoid using sudo to install gems and also ensures that if you upgrade your Mac, and Apple have changed something with the Ruby setup (which they often do), it's likely that your Ruby versions and projects will still work, as they are separate and independent of the system Ruby on OS X.

Install RVM

Run this in your terminal:

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

Windows

I've not much experience with running Ruby or working on Ruby projects on Windows, although typically I've found that Windows can be temperamental (to say the least) when trying to use tools outside of the Microsoft ecosystem.

RubyInstaller is a self contained installer for Windows which will install a version of Ruby and RubyGems and some required extensions to get Ruby working on Windows.

@hamstarr
Copy link

hamstarr commented Feb 4, 2014

How about Xcode or Commandline Tools requirement?

@zakgrant
Copy link

zakgrant commented Feb 4, 2014

You can always use the experimental fork of Homebrew for Linux -> https://github.com/Homebrew/linuxbrew

I have used it with much success...

@kierangraham
Copy link
Author

@hamstarr Good point, forgot about that! I'll add an update shortly.

@zakgrant Nice, I've not come across that before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment