Skip to content

Instantly share code, notes, and snippets.

@spacecowb0y
Created November 22, 2012 15:21
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spacecowb0y/4131680 to your computer and use it in GitHub Desktop.
Save spacecowb0y/4131680 to your computer and use it in GitHub Desktop.
Setup your development environment Rails and MySQL on OSX using Homebrew and RVM
  1. Install the command line tools for your OS X =================================================

This package enables UNIX-style development via Terminal by installing command line developer tools, as well as Mac OS X SDK frameworks and headers. Many useful tools are included, such as the Apple LLVM compiler, linker, and Make.

  1. Install Git =================================================

Git is a distributed revision control and source code management (SCM) system with an emphasis on speed

  1. Install Homebrew =================================================

The missing package manager for OS X

Run this command on your terminal:

ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
  1. Install RVM and the latest Ruby version =================================================

RVM is a command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems.

Run this command on your terminal:

curl -L https://get.rvm.io | bash -s stable --ruby
  1. Make Ruby 1.9.3 default =================================================
rvm default 1.9.3
  1. Install MySQL =================================================
brew install mysql

To have launchd start mysql at login:

ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents

Then to load mysql now:

launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

Or, if you don't want/need launchctl, you can just run:

mysql.server start
  1. Install Bundler and Rails =================================================
[sudo] gem install bundler
[sudo] gem install rails

And now your ready to start your project using rails and mysql.

rails new my_project -d mysql && cd my_project && rails s
open http://0.0.0.0:3000

If everything it's working as it should your rails server should be up and running on this URL: http://0.0.0.0:3000

Easy right?

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