From Start To Finish Install Ruby On Rails On Osx Deploy On Heroku
From Start To Finish Install Ruby On Rails On Osx Deploy On Heroku
Ruby on Rails is one of the most popular web development frameworks, and Heroku has become a popular place to quickly deploy applications – and both for very good reason. For this guide, you will need a Heroku account (it’s free to sign up). This guide also assumes that you’re running OSX 10.10. Beyond those two assumptions we will try to go from ground zero to have a local rails development environment and an environment on Heroku.
- 1 ea OSX 10.10
- 1 ea Heroku Account
- 1 ea Ruby 2.0
- 1 ea Rails 4.2
- 1 ea RVM
- 1 ea git
- 1 ea xcode
If Xcode is already installed, you can skip this step. To check, open your Terminal application and type:
xcode-select -p If Xcode is installed you will see the path in the Applications directory:
/Applications/Xcode.app/Contents/Developer If it’s not installed type:
xcode-select --install and you will be prompted to install the Xcode Command Line Tools.
After installing, verify the install:
$ xcode-select -p /Applications/Xcode.app/Contents/Developer and finally ensure gcc is installed:
$ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) Target: x86_64-apple-darwin14.1.0 Thread model: posix
Git is a popular version control software, and it will be required to push to Heroku in later steps. If you’ve successfully installed Xcode, git will be installed as well. You can go ahead and configure git now.
First, you can confirm that git is installed:
$ git --version git version 1.8.3.4 (Apple Git-47) and now configure it by typing:
$ git config --global user.name "Your Real Name" $ git config --global user.email me@example.com $ git config -l --global user.name=Your Real Name user.email=me@example.com The above commands will set your name and your email address. Then the third line simply checks to make sure they were set properly. These values will be used to identify your commits.
Homebrew is a popular package manager for OSX. There are other great package managers, but for this guide we will use homebrew.
To install type:
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
RVM is the ruby version manager. This allows you to have multiple ruby environments on the same machine. You may not need multiple environments, but it’s the easiest way to setup the environment you need for this guide.
To install type:
curl -L https://get.rvm.io | bash -s stable --ruby
The –ruby flag installs the latest version of ruby.