There is an updated version of this post for OS X 10.9. While the steps below should still work, I recommend checking out the new guide if you are running 10.9!

  1. Git Download For Lion Mac Osx
  2. Git Bash Download Mac
  3. Installing Git On Mac
  4. Git Download Mac Os

Atom is free to download and runs on Linux, OS X and Windows with support for plug-ins written in Node.js and embedded Git Control. It is based on Electron (formerly known as Atom Shell),a framework for building cross-platform apps using Chromium and Node.js. Gitbox is offered on both Mac App Store and with an old-school license. Both builds are the same and distributed on the same conditions: the license is for personal use, on any number of machines. Updates are free. Gitbox in Mac App Store. Gitbox on FastSpring. Students are offered 50% discount coupon (a scan of student ID required).

There are already plenty of guides that explain the particular steps of getting Git and Github going on your mac in detail. However, I had difficulty finding one that explained every step required in order with simple enough instructions for Terminal novices to follow along with autonomously.

So I decided to write one myself.

Background

I enjoy helping people become more efficient and productive, particularly when it comes to their computers and mobile devices. At a recent job, the staff design team was beginning a period of close collaboration with the front-end development team in the interest of achieving the best possible product in the shortest period of time.

However, there was a slight “problem.” The project’s codebase was exclusively managed via Git repositories on Github. Most of the designers had never worked with Git, let alone ever configured it on their workstations.

Most of the designers had some knowledge of the technologies that went into the codebase, particularly presentation layer tech like HTML and CSS. Some even knew programming languages like Javascript, PHP, and Ruby.

In an effort to unleash this previously untapped resource for a round of intense polishing and bug-fixing, I took it upon myself to write a step-by-step guide that any member of our studio could follow and be up and running with developer tools, Git, connected to Github, and ready to work on the project codebase.

This then is a slightly abbreviated1 version of the guide I distributed out to the team. Ultimately just a few days after releasing it, nearly everyone in the office — including design, production, management, and even a few devs setting up new machines — was able to at least view the latest code on their workstations.

Aside from the fact that my guide helped others quickly get through the arduous process of installation and configuration, I was happy to have it as a quick reference for myself when setting up new machines of my own. Enjoy!

Getting started

This tutorial assumes you’re using a Mac running at least OS X 10.7. If you are unsure of what OS you have, go up to the top left of your screen, click the Apple menu, and select “About This Mac.”

You’ll also need to ensure that your user account on your computer has admin privileges and that you know your account’s password.

Install the Command Line Tools for OS X

Xcode is a nearly 4GB developer suite Apple offers for free from the Mac App Store. However, for the purposes of getting Git and Github setup, you’ll only need a specific set of command line tools2 which fortunately take up much less space.

If you don’t mind the 4GB, by all means go for Xcode. Otherwise, you’ll have to go to connect.apple.com and register an Apple Developer account in order to download these tools.

Once you’ve registered, they can be found at developer.apple.com/xcode by clicking on “View downloads” and finding the appropriate command line tools for your version of OS X in the list.

  1. If you are on OS X 10.7.x, download The 10.7 Command Line Tools. If you are on OS X 10.8.x, download The 10.8 Command Line Tools.
  2. When your download finishes, go ahead and open the DMG.
  3. Run the Command Line Tools installer.

A note about the Terminal

The Terminal application comes pre-installed with OS X, and can be found in the Applications -> Utilities folder. You can also quickly access it using Spotlight.

The terminal has a variety of uses, but for the purposes of this tutorial we’ll be using a syntax/command set called Bash. Terminal is already configured to use this syntax.

When you enter a command and press return/enter, often times the terminal will execute it and complete the task immediately.

Sometimes it will log information in the window while it’s working, but other times you might feel like it isn’t doing anything at all.

Some of the commands later in this tutorial can take a few seconds (or minutes) to complete, so don’t type anything into the terminal window or close the terminal window until you see it present you with a fresh prompt ending in yourusername$.

For the purposes of this tutorial, commands that I intend for you to type will be preceded with $, but don’t include that symbol when you enter the commands. It’s purely meant as an indicator and reference to the $ that appears in your terminal prompt.

Lines that contain comments/notes from me to will be preceded with # and will be dimmed. Don’t type these either.

Make sure to press return after typing a command before you enter the next one.

Installing Git

“Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.”

We need to install Git onto your computer. It won’t have an icon in your dock, but it can be used by the Terminal (and other applications, more on that later).

OS X comes with a fairly old version of Git pre-installed, so we’ll want to make sure that your terminal is using a more updated version.

One specific reason you’ll want to have a newer version of Git than the one that ships with OS X is to take advantage of a nice authentication feature that allows you to seamlessly interact with Github.

  1. Download the latest stable release of Git. It should start downloading a DMG which for some reason will include the words “Snow Leopard” in the file name…don’t worry, it works with Lion and Mountain Lion just fine.

  2. When it’s done downloading, open the DMG and run the package installer.

    Note: If you are using OS X 10.8 and haven’t already modified your security settings to allow the installation of third-party applications, you’ll need to make that adjustment3 before OS X lets you install these tools.

  3. Once the installer has finished, open the Terminal app and type git --version followed by the return key. Note that there are two dashes, not one.

  4. The terminal should report back with your currently installed Git version.

    If it reports a Git version that matches the version number marked on the DMG you downloaded (as of writing, this would be 1.8.1.3) proceed to Configuring Git identification, otherwise you’ll need to execute the following:

Configuring Git identification

Now let’s configure your Git installation so other folks who might be working on projects with you know who’s doing all of the great work coming from your computer.

Setup Github

GitHub is a web-based hosting service for software development projects that use the Git revision control system.

Go to Github.com and create a free account if you haven’t already.

Github Keychain Helper

To save time in the future, we’ll install a utility that will allow your computer to authenticate with Github automatically instead of having to enter your username/password during each session.

First, check if the helper is installed by typing git credential-osxkeychain into the terminal.

If the helper is installed, the terminal will give you instructions on how to use it:

If see the above message, you are now able to access Git repositories using the HTTPS method. There’s a very good chance that this is the only method you will need to access repositories and you can move on to my final notes.

If you don’t have the keychain helper already installed, you’ll see this instead:

To install the keychain helper, execute the following commands:

Once again, if the helper has been installed successfully, the terminal will give you instructions on how to use it:

If see the above message, you are now able to access Git repositories using the HTTPS method. There’s a very good chance that this is the only method you will need to access repositories and you can move on to my final notes.

If you don’t see the above message, you hit a snag along the way. Try going through the keychain helper install steps again.

Otherwise, if you have a specific reason that you need to access Git repositories using SSH, proceed to SSH Keys.

SSH Keys (optional step)

“SSH uses public-key cryptography to authenticate the remote computer and allow it to authenticate the user, if necessary. There are several ways to use SSH; one is to use automatically generated public-private key pairs to simply encrypt a network connection, and then use password authentication to log on.”

An SSH key basically lets your computer uniquely identify itself when it connects to servers. If Github is aware of the key your computer is using, you won’t have to enter your Github username/password every time you connect.

Check for pre-existing SSH keys on your computer

Let’s see if your computer has one or more keys already installed:

If you get the response “No such file or directory”, skip to Generate a new SSH Key.

Otherwise, you’ll need to backup and remove your existing SSH keys.

For
Backup and remove your existing SSH keys.
Generate a new SSH key

Now we’ll create a new SSH key to use with Github.

Java SE Development Kit 8 Downloads. Thank you for downloading this release of the Java™ Platform, Standard Edition Development Kit (JDK™). The JDK is a development environment for building applications, applets, and components using the Java programming language. Java is a runtime environment maintained by Oracle that you must install on your Mac to be able to run applications written using the Java programming language. Moreover, Java allows developers to make apps available on multiple operating systems at the same time because Java-based utilities. Java 8 mac free download - Java SE Development Kit 8, Java Update for Mac OS X 10.3.9, Apple Java for OS X 10.6, and many more programs. Download Java SE 8 Environment 8 1.8.11.12 for Mac. Fast downloads of the latest free software! Jul 14, 2020. Mac

When it asks you to enter a file name in which to save the key, just press return/enter (leave the prompt blank).

You will then be asked to enter a passphrase and confirm it. Don’t make this blank, and don’t make it an easily guessable. This prevents someone from easily acquiring and using your SSH key to impersonate you. Don’t worry, you won’t have to enter this key much (if at all) after initial setup.

Press return after each time you’ve entered your selected passphrase. You won’t see the characters or bullets, the cursor will stay in the same spot as if you aren’t typing.

If you make an error entering your password one of the times, just press return and it will prompt you to try again.

Once you’ve successfully set your passphrase, the terminal will report that your key has been saved and will present you with some sweet ASCII art.

Add your SSH key to Github

In order for your computer to access Github without you having to enter your username/password all the time, Github needs to know the contents of the SSH key you just generated.

Now we’ll add your key to Github:

  1. Visit your account settings.
  2. Click Add SSH key.
  3. Enter a descriptive title for the computer you’re currently on, e.g. “Work iMac” into the Title field.
  4. Paste your key into the Key field (it has already been copied to your clipboard).
  5. Click Add Key.
  6. Enter your Github password.

Now let’s test that it all worked.

Congratulations!

Your Mac is now up and running with both Git and Github. I intend to write another post about some of the commonly used commands I always find myself looking up syntax for, as well as those that members on the team had to learn in order to effectively take part in the production process.

Recommended tools

Text Editors

If you’re just getting your feet wet with writing code, you’ll want to look into a text editor that is purpose built for that task.

My hardcore colleagues wouldn’t leave me alone if I didn’t also mention command-line editors like Vim and Emacs, but I’d recommend one of the previously listed apps for getting started.

I don’t recommend using TextEdit as it doesn’t offer syntax highlighting, and I’m personally not fond of Dreamweaver for writing code as I feel it allows its WYSIWYG mode to be used as a crutch. That said, Dreamweaver’s predecessor4 in Adobe’s product lineup was what I learned to write HTML on, so there’s that.

However with the explosion of online code teaching platforms out there (and Firebug/DOM inspector tools), I don’t see the need to use a WYSIWYG editor anymore.

Git GUI Tools

When I first started dabbling with Git, I used the popular Tower app to manage my repositories. It has a fantastic interface and offers most of the features of the command line app.

However when we began this endeavor at my past job, the development team and I wanted to ensure that all persons with access to the codebase thought about what the actions they were going to take, and deliberately execute commands.

GUI tools are great, but they can sometimes allow disastrous things to happen with the push of a button. Additionally they can abstract away the syntax of the language/protocol they are built upon, and as a result leave users dependent on the GUI rather than knowledgeable about the underlying technology.

If you must use a GUI tool, by all means do. However in the circumstances I mentioned, it wasn’t an option we wanted to offer.

Terminal Configuration

I’ve been enjoying iTerm2 for a few small perks it offers, mainly the ability to have perfect representation of the Solarized Dark theme.

Feedback

If there are any steps/instructions I’ve written that have been outdated by newer information/technology, are simply wrong, or could be explained better please feel free to contact me on Twitter where I’m @burnedpixel.

  1. The stack for this project was very complicated and resulted in us using Vagrant and VirtualBox to literally get virtual instances of the dev environment going on each workstation.↩

  2. I had hosted the appropriate DMGs for the 10.7 and 10.8 tools on a local fileserver to speed up this step. Unfortunately the general public will have to go to Apple’s developer site, sign up for a free account, and download the tools from there.↩

  3. Security settings adjustment to install Git:

    • Go to Apple Menu > System Preferences
    • Click Security & Privacy
    • Click the lock icon in the bottom left and enter your account password
    • Select “Anywhere” for the “Allow applications downloaded from” setting
    • Close System Preferences
  4. While I may have been exposed to making web pages by software like Claris Home Page and Microsoft FrontPage, I really learned to write HTML by hand from a software suite called GoLive Cyberstudio. In what has now become a familiar process, Adobe bought GoLive out so they could integrate Cyberstudio into their product lineup. In what has now also become familiar, Cyberstudio (simply rebranded as GoLive) rarely got any updates and lived a deprecated existence until it’s death nearly 10 years later.↩

This tutorial was last updated on February 22, 2019.

NEW: My laptop script can automate the whole setup for you.

After following many outdated and incomplete instructions for setting up a web development environment on a Mac (back in March 2012), and spending a lot of time finding solutions to the problems I encountered along the way, I decided to put together this detailed tutorial.

Over time, as tools have improved, and with new releases of macOS, I've updated this tutorial. Ever since Mavericks, setting up a development environment on a Mac with Apple's standalone Command Line Tools, Homebrew, Git, RVM, Ruby, and Rails has been a fairly stress-free process that's no longer fraught with the issues I ran into in 2012.

In fact, the whole process can now be automated via the laptop script that I wrote for you.

Whether you use my script that does everything for you, or set everything up manually, it's best that you start with a clean installation of macOS. If you've already tried to install a development environment, I can't guarantee that you won't run into any issues. Certain tools used in this tutorial might not be compatible with whatever you might have installed. For example, RVM is not compatible with rbenv, and MacPorts is not compatible with Homebrew.

Click on your macOS version below to get started:

Historical Background

Up until February 2012, the only way you could get the Command Line Tools required for web development was via the full Xcode package, which is almost 2 GB in size. Since then, Apple started offering the Command Line Tools (CLT) as a separate, much smaller download (~118MB), which benefits those who don't plan on writing Mac or iOS apps.

There is also a third-party option, the osx-gcc-installer by Kenneth Reitz, that supports both Snow Leopard and Lion. However, it is not updated as often as the official Apple tools, and I personally ran into issues with it on Lion.

When I tried Apple's CLT for Lion back in March 2012, they weren't compatible with Homebrew:

As of August 6, 2012, the issue above is no longer present with the latest CLT for Mountain Lion, and I believe that's the case on Lion as well, but I haven't confirmed that yet. Until I do, I recommend getting the CLT from Xcode if you're on Lion, as explained in this tutorial.

The Easy Way for Mavericks and above

I've written an open source script that canset everything up for you, includingconfiguring your Mac to work with GitHub.

If you prefer to do everything manually, start with Step 1 below.

Step 1: Download and Install the Command Line Tools

Installing the standalone Command Line Tools on Mavericks and above

Most of the work you'll be doing in this tutorial will be in the 'Terminal' application.The easiest way to open an application in OS X is to search for it via Spotlight. The default keyboard shortcut for invoking Spotlight is command-Space. Once Spotlight is up, just start typing the first few letters of the app you are looking for, and once it appears, select it, and press return to launch it. See the animated GIF below for an example:

Inside the Terminal window, copy and paste (or type) the following command, and press the return key on your keyboard:

You should see the pop up below on your screen. Click Install when it appears.

Click Agree when the License Agreement appears:

Your computer will then attempt to find the software, and then will start downloading it.The following popup will appear:

Once the software is installed, click Done. That's it! You're now ready to go to Step 2.

Installing the standalone Command Line Tools on Mountain Lion

Go to https://developer.apple.com/downloads and sign in with your Apple ID (the same one you use for iTunes and app purchases).

Search for 'command line tools' (in the search field on the left), then click on the latest version of 'Command Line Tools (OS X Mountain Lion) for Xcode,' and click on the the .dmg link to download it.

Once the .dmg has finished downloading, double-click on it (if it didn't already open automatically). This will mount the disk image and open a window in your Finder that looks like this:

Double-click on the 'Command Line Tools (Mountain Lion).mpkg' installer and go through the installation. Once the CLT are installed, launch the 'Terminal' application via Spotlight (as explained in Step 1), then go to Step 2.

Installing Xcode on Lion

Click on this link to Xcode on the Mac App Store, then click on 'View in Mac App Store.'

It should automatically launch the 'App Store' app on your Mac and take you the Xcode page. Click on the 'Free' button, then click on 'Install App.'

Once the installation is complete, go to your Applications folder and double-click on Xcode, then install any required components if asked to.

Go to Xcode's Preferences via the menu bar, or by pressing the command and comma keys.

Click on the 'Downloads' icon, then click on the 'Install' button next to 'Command Line Tools.'

When prompted to log in, you should be able to use the same email and password you use for iTunes and app purchases. Once the Command Line Tools are installed, quit Xcode, launch the 'Terminal' application via Spotlight (as explained in Step 1), then go to Step 2.

IMPORTANT NOTE: If you upgraded to Mountain Lion from Lion, and you already had Xcode installed on Lion, and you updated to Xcode 4.4 and updated the Command Line Tools while still on Lion, you will have to go back to Xcode and download the Command Line Tools again after upgrading to Mountain Lion.

Snow Leopard Instructions

UPDATE: A kind reader (P. Martin) pointed out that the Xcode 4.2 download for Snow Leopard is only available to those registered in the $99/year developer program. I confirmed that the latest version of Xcode for Snow Leopard available to me while signed in with a free account is 3.2.6. I have not tested this setup with Xcode 3.2.6, but I would love to hear from you if you have. Otherwise, I recommend that you upgrade to a newer version of OS X.

Go to https://developer.apple.com/downloads and sign in with your Apple ID (the same one you use for iTunes and app purchases).

If you are part of the $99/year Apple developer program, search for 'xcode 4.2' (in the search field on the left), then click on 'Xcode 4.2 for Snow Leopard,' and click on the .dmg link to download it.

Otherwise, search for 'xcode 3.2', then click on 'Xcode 3.2.6 and iOS SDK 4.3 for Snow Leopard,' and click on the .dmg link to download it. As mentioned at the beginning of this section, I have not tested this tutorial with Xcode 3.2.6, so I would recommend that you upgrade to a newer version of OS X.

Once the .dmg has finished downloading, it should automatically mount the disk image and open a window in your Finder that looks like this:

Double-click on the 'Xcode' package installer. Once the installer launches, make sure all the checkboxes are checked, as shown in the screenshot below:

Click 'Continue,' and go through the rest of the installation. If the installation fails, quit the installer, then run Software Update and install any updates that it finds.

If no new updates are available, restart your computer and try installing Xcode again. Once Xcode is successfully installed, you can move on to Step 2.

Step 2: Install Homebrew

Homebrew, 'the missing package manager for OS X,' allows you to easily install hundreds of open-source tools. The full installation instructions are available in the Homebrew Documentation, but you should only need to run the command that's listed at the top of the Homebrew site:

Note that the command listed on the Homebrew site could change, so please make sure that what I have listed above is the same. If it isn't, please let me know and I'll update it.

Copy and paste the command into your Terminal window, press return, then follow the instructions when prompted, as highlighted in the screenshot below. Note that Terminal does not provide visual feedback when you type your password. Just type it slowly and press return.

Once the installation is successful, run the following command:

If you get Your system is ready to brew, you can move on to Step 3. Otherwise, go to the Troubleshooting section to learn how to fix errors and warnings you might run into.

Step 3: Install Git

Git is the version control system of choice among many web developers. With Homebrew, installing Git is as easy as this:

Since we just installed Homebrew, we could have skipped brew update, but it's a good habit to run it before installing anything with Homebrew because Homebrew is updated regularly.

To verify:

You should get git version 2.20.1 or later.

Run brew doctor to make sure everything is still working. If your system is ready to brew, you can move on to Step 4.

Step 4: Configure Git with GitHub for Mac

Download, install, and launch GitHub for Mac.

If you don't have a GitHub account, click on the Sign Up at GitHub.com link in the app, then come back to the app to complete the setup. I highly recommend that you turn on two-factor authentication for your GitHub account.

Follow these steps to set up GitHub for Mac when you first launch it:

  • Click Continue
  • Enter your username and password, then click Sign In
  • Enter your two-factor authentication code (if you have it turned on)
  • Click Continue
  • Enter an email address that you want to be attached to your commits. It doesn't have to be your real email address, but if you leave this blank, Git will nag you about it every time you commit.
  • Click Continue
  • Click Done

To see this setup in action, go to the 1:26 mark in the video I created toshowcase my automated script.

Step 5: Install RVM with the latest Ruby (2.2.0) and Rails (4.2.0)

RVM stands for Ruby Version Manager, and is one of the most popular tools that allow you to install and manage multiple versions of Ruby and Rails on the same computer.

RVM has come a long way since I originally published this tutorial. As of March 30, 2013, you can now install the latest RVM, Ruby, and Rails in one step. However, because RVM installs documentation for every gem that Rails depends on, which takes forever, I recommend disabling documentation first:

Now you can install everything with one command. If you're not interested in Rails, just replace --rails with --ruby in the command below:

Read the RVM installation documentation to see all the different options you can use.

This will take a few minutes, and once it's done, quit and relaunch Terminal, then run this command:

If you get rvm is a function, that means RVM was successfully installed. If not, go to the Troubleshooting section.

To make sure the latest versions of RVM, Ruby and Rails were installed, run the commands below:

For RVM

You should get rvm 1.26.10 or higher.

For Ruby

You should get ruby 2.2.0 or higher. If you get dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib, that means something is wrong with the binary version of the latest Ruby. To fix it, reinstall your desired Ruby version by disabling the binary:

For Railsrails -vYou should get Rails 4.2.0 or higher.

To make sure your system is still ready to brew:brew doctorIf everything went well, you're done! Your machine is now set up with the basic tools for web development.

If you got any value out of my tutorial, I have more time-saving tips and tricks for you in my free newsletter.

Next Steps

Once you start hacking away on your computer, you will most likely need to install more tools with Homebrew. Before you do, remember to always run brew update and brew doctor to make sure your system is still ready to brew. To upgrade your existing packages, run brew upgrade.

If you installed the full Xcode package, remember that when you update it via the Mac App Store, you might also need to update the Command Line Tools via Xcode's Preferences. If you installed the standalone CLT, I recommend checking for a new version once a month or so.

If you followed this tutorial because you're interested in Rails development, I recommend visiting Daniel Kehoe's excellent RailsApps Project.

If you want to install another version of Ruby besides 2.2.0, follow the instructions below.

Installing other versions of Ruby, such as 2.1.5

Before you install a version of Ruby with RVM, you should make sure you have the latest version of RVM:

Then run:

To see all the versions of Ruby installed via RVM:

This output also lets you know which version is the default and which one is the current one in use.

To use a specific version (2.2.0 in the example below) and also set it as the default version for new shell sessions:

To verify:

The version should match that of the current Ruby in use.

Troubleshooting

Homebrew

In many cases, Homebrew will provide helpful instructions for dealing with warnings and errors, and I usually follow those instructions. I've tried to cover the most common sources of warnings and errors. If you run into an issue I haven't mentioned, try looking it up in the Homebrew GitHub Issues, or Google the error message. If that doesn't help, contact me and I'll do my best to help you.

After you fix each issue, run brew doctor until you get Your system is ready to brew. Then go to Step 3.

If you get Warning: /usr/bin occurs before /usr/local/bin, run the command below (as recommended by Homebrew), and quit and relaunch Terminal:

This command takes everything between the single quotes and adds it (>>) to a file called .bash_profile in your user's root directory (~/). Every time you open a new Terminal window or tab, .bash_profile is called. The export PATH line tells your system to look in /usr/local/bin first, since that's where Homebrew installs tools.

If you get Warning: Experimental support for using Xcode without the 'Command Line Tools', you probably upgraded from Lion to Mountain Lion but didn't reinstall the Command Line Tools. See the important note in Step 1.

If you get Error: No such file or directory - /usr/local/Cellar, run the following command, which creates the /usr/local/Cellar directory:

sudo allows you to run commands as a user with higher access rights, which is why it prompts you for your password, and mkdir stands for 'make directory.'

Git Download For Lion Mac Osx

If you get /usr/local/etc isn't writable or Cannot write to /usr/local/Cellar or if it complains that any directories inside /usr/local aren't writable, fix it with this command:

Git Bash Download Mac

This makes you the owner of the /usr/local directory, in addition to all nested directories.

chown stands for 'change owner,' the -R flag applies this to all nested files and directories, and whoami is a variable that represents your OS X username. You should copy and paste the command above as is.

To learn more about any Unix command, type man (for 'manual'), followed by the command. For example:

If a manual is longer than a page long, it will display a : at the end to signify there is more to read. To display one additional line at a time, press return. To display an additional page at a time, press the space bar. To quit at any time, press q.

If you get Warning: Unbrewed dylibs were found in /usr/local/lib, or a warning about any type of unbrewed files or static libraries, you may need to delete them as suggested by Homebrew (unless you put them there on purpose, which is unlikely). You'll have to delete each file it complains about one by one with the rm command. For example, to remove a file called libgd.2.0.0.dylib from /usr/local/lib, you would run this command:

If you get Warning: Python is installed at /Library/Frameworks/Python.framework, or Warning: 'config' scripts exist outside your system or Homebrew directories related to Python, it most likely means you installed Python with a tool other than Homebrew. If you think you might need this version of Python, then just ignore those warnings. Otherwise, run the command below to remove that version of Python, but read this thread first.

If you're on Lion, you might get this:

This should fix it:

Run brew doctor to verify. Your system should be ready to brew now.

In some cases, brew doctor might show you this warning:

Homebrew messages are generally very helpful and they let you know exactly what to do. In this case, it is telling you to fix the linking issue by running brew unlink, followed by the tools (or 'brews') that need to be unlinked. Here, there is only one tool that needs to be unlinked. Therefore, you should run this command:

If it listed more than one tool, you would add them to the command separated by a space, like so:

Run brew doctor once more, and you should be ready to brew now.

RVM

If you're installing RVM on a machine that has gpg installed (which won't be the case on a new Mac), you will get a GPG signature verification failed error. Make sure to follow the instructions in the error message. At the time of this writing, you will need to run the command below to download the signatures, after which you can go back to step 5 to install RVM.

How to load RVM into your shell session as a function

Run this command:

Now that .bash_profile has been modified, it needs to be reloaded. For initial RVM installations, the preferred way to do this is to quit and relaunch Terminal. Otherwise, you can use the following command:

If all went well, you should see rvm is a function after you run this command:

Previous Notes

Installing Ruby on Snow Leopard and Lion is presumably as easy as on Mountain Lion, but I haven't been able to verify that. The instructions below are based on my experience in 2012. I've left them here for reference but I'm not sure if they still apply. For example, running rvm requirements used to provide instructions specific to your environment, but now it tries to install all the requirements for you.

The screenshots below are examples of the kind of output rvm requirements would show. One is for Snow Leopard 10.6.8 with Xcode 4.2, and the other for Mountain Lion 10.8 with no Xcode:

According to the requirements, we must first install libksba. This applies to Snow Leopard, Lion and Mountain Lion.

We can do that easily with Homebrew, but first we should make sure it is up to date:

Since Homebrew is updated regularly, it's advisable to run brew update before installing anything with Homebrew.

Now we're finally ready to install Ruby 1.9.3! If you're on Snow Leopard, you need to add a flag to the command (as specified in the RVM requirements):

Installing Git On Mac

If you're on Lion, you need to install automake first:

Otherwise, you will get this error when installing Ruby 1.9.3:

If you're on Mountain Lion 10.8.2 with Xcode 4.5, you will need to run these commands first:

Git Download Mac Os

The steps above are necessary for you to be able to install Ruby gems, such as Rails. Otherwise, you will run into errors such as these: