-
Notifications
You must be signed in to change notification settings - Fork 0
Setting up development environment
To get the development environment setup for OS 10.9 please follow the below instructions. All of the commands are to be typed inside the command line so have that open. The $
indicates the prompt, don't actually type it in.
$ xcode-select --install
Follow the UI that pops up to install the command line tools.
Type $ xcode-select -p
to verify that it is installed. The command should print out /Library/Developer/CommandLineTools
.
$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
Type $ brew doctor
to check that you've installed it properly. Follow the instructions that it gives for fixing any issues.
open the file called .bash_profile
(or .zshrc
if you have it) in the home directory.
add a line at the end:
PATH=/usr/local/bin:$PATH
$ brew install git
To check that you've installed it properly:
$ git --version
$ git config --global user.name "Your Actual Name"
$ git config --global user.email "Your Actual Email"
Verify with:
$ git config --get user.name
$ git config --get user.email
$ brew update
$ brew install rbenv ruby-build
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
Note: replace .bash_profile
with .zshrc
if you've installed oh-my-zsh.
Restart your terminal at this point.
Get the Ruby version# from Curri's Gemfile. For example, if the Gemfile says ruby "2.0.0"
then from the command line run $ rbenv install --list
and find the latest 2.0.0 patch.
$ rbenv install <version#>
$ rbenv global <version#>
$ gem update --system
$ gem install bundler
Check that Ruby is installed with $ ruby -v
.
$ brew install postgresql
$ initdb /usr/local/var/postgres
$ psql --version
$ which psql
The last command should return /usr/local/bin/psql
Now to get Postgres running type this:
$ mkdir -p ~/Library/LaunchAgents
$ cp /usr/local/Cellar/postgresql/<psql-version>/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents
$ gem install lunchy
$ lunchy start postgres
In the copy command above, replace with the version number. For example, if psql --version returns 9.3.2 then do:
$ cp /usr/local/Cellar/postgresql/9.3.2/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents
Use $ lunchy stop postgres
to stop Postgres.
If the above command line process doesn't work (especially if you get homebrew errors) then try the following:
- Download the app from http://postgresapp.com/
- Install and run the app
- In the command line type
$ echo 'PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"' >> ~/.bash_profile
- Restart your computer
- The app needs to be on whenever you use Rails. It'll add a little elephant icon in the top right corner of your screen.
$ brew update // to update Homebrew itself
$ brew upgrade <package-name>