Note the double hyphen:. The instructions in the alert box are confusing. If you have a slow Internet connection, it may take many minutes.
If the download takes a very long time over an hour or fails, you can try an alternative. You'll be asked to agree to the terms of the Apple Developer Program. You'll see a list of software packages you can download. Look for the latest version of Command Line Tools and click to download the. Downloading the. Install the. The Xcode Command Line Tools must be installed before you go to the next steps.
Just to be certain, verify that gcc is installed:. Before installing Ruby on Rails, you should configure Git. Git is automatically installed as part of the Xcode Command Line Tools. Git provides a source control repository. Developers use Git to roll back code changes as needed, to collaborate with others, and deploy applications for hosting with a service such as Heroku.
See the article Rails with Git and GitHub for more background. First, list the current settings with the git config -l --global command. Then set user. Before you do this, it is a good idea to create an account on GitHub. You don't have to, but it is important to use the same email address for git and for GitHub. Don't just copy and paste the code below. Edit it to add your name and the email address you've used for GitHub. If you did not use a password to log in to your Mac that is, if your password is blank , you cannot install Homebrew.
Many developers use Homebrew to install various Unix software packages. If Homebrew is not installed, install it:. Ignore the scary warning and enter your Mac password. You won't see the characters as you type.
Press enter when you are done. You may notice that we use Ruby to install Homebrew. We use the macOS pre-installed system version of Ruby to install Homebrew. Soon we'll add a newer version of Ruby using RVM. You can use Homebrew to install gpg , an encryption program used to check the security of the RVM download. Installing gpg eliminates a warning message which will halt installation of RVM. If your Mac user name contains a space character, you must change you account name to remove the space. RVM includes an "autolibs" option to identify and install components needed for your operating system.
If you already have RVM installed, update it to the latest version and install Ruby:. You can use rvm implode to remove all traces of RVM from your system except changes it makes to your shell files such as. IRC on freenode requires registration see how to register. RVM will leave your "system Ruby" untouched and use your shell to intercept any calls to Ruby. The system Ruby will remain on your system and the RVM version will take precedence.
You can check for the current recommended version of Ruby. You must specify a version number to install the newest stable Ruby version:. You may be asked to enter a password. When you enter the password, type carefully.
You will not see the characters you enter. Sometimes a precompiled version of Ruby is available. If not, it takes a long time about five minutes to install Ruby because the computer must compile the source code. RubyGems is the package manager in Ruby. We use it to install software packages that add functionality to Ruby.
Don't type the number you see above. It's just to show you the response you might get from your computer. At the time this was written, a newer RubyGems version was available. Use gem update --system to upgrade the Ruby gem manager:. Not all Rails developers use RVM to manage gems, but many recommend it.
You can track updates to gems at the RubyGems. Search for each gem you use and "subscribe" to see a feed of updates in the dashboard an RSS feed is available from the dashboard. These services survey your GitHub repo and send email notifications when gem versions change. Gemnasium and VersionEye are free for public repositories with a premium plan for private repositories. By default, when you install gems, documentation files will be installed.
Installing gem documentation files takes time, so many developers like to toggle the default so no documentation is installed. This adds the line gem: --no-document to the hidden. The Bundler gem is an essential tool for managing gems when developing and running Rails applications.
Could you please let me know what the folder 'Ruby' in '/Library' is? It has 2 I am not sure if it is a pre-installed folder or it got installed later?. Tips and Tricks: Setting Up Ruby On OS X Starting Location. When you launch a new terminal on a Mac, you'll always be located in your home directory It's the terminal way of entering a folder, just like double-clicking that folder in Finder.
RVM used to install Bundler automatically. As of version 1.
You must install Bundler:. Nokogiri is a gem that is a dependency for many other gems. Nokogiri is a gem that requires compilation for your specific operating system.
You'll find instructions below. John Paul Ashenfelter John Paul Ashenfelter 2, 1 1 gold badge 17 17 silver badges 28 28 bronze badges. Github is the leading platform for source code hosting and collaboration. Step 1. Github is the leading platform for source code hosting and collaboration. Here's how to install the Xcode Command Line Tools. Several gems are installed with Ruby or the RVM default gemset: bundler-unload rake rubygems-bundler rvm There may be others as well.
However, compilation takes time. During installation, Nokogiri will display two lengthy messages in the console. It will also pause without displaying any progress for as long as five minutes. If installation fails, make sure your system is configured properly look for help on Stack Overflow. Check for the current version of Rails. Rails 5. You can install Rails directly into the global gemset.
However, many developers prefer to keep the global gemset sparse and install Rails into project-specific gemsets, so each project has the appropriate version of Rails.