2013-12-02
Before installing Ruby, you’ll need to prepare your computer by installing Apple’s Xcode Command Line Tools.
The Xcode Command Line Tools provide a C language compiler needed to install Ruby. For many Rails projects, you will need the C language compiler to install gems that use native extensions.
Mac OS X Mavericks will alert you when you enter a command in the terminal that requires Xcode Command Line Tools. For example, you can enter gcc, git, or make.
Try it. Enter:
$ gcc
Reference:
Set aliases, color scheme, and paths.
Clone chriskk Dot Files into ~/
$ git clone https://github.com/chriskk/dotfiles.git
Local environment variables are set within localrc, which is ignored by git. Add local paths such as /usr/local
and any aliases to localrc.
# Create a locarlrc file
$ cd dotfiles
dotfiles $ vim localrc
Run the installation script, which will symlink the dot files. Existing symlinked dot files are not touched.
dotfiles $ rake install
Pull in latest vim plugins
dotfiles $ git submodule update --init
Use Homebrew to install and manage: gcc-4.2, MySQL, Postgres, ImageMagick, and other packges.
$ ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
$ brew doctor
$ brew update
$ brew install git
# Open up a new terminal
$ git --version
git version 1.8.5
Because Mavericks, like Mountaion Lion, doesn’t come with GCC 4.2, it needs to be installed and linked to the correct place. Some packages require it so it’s best to install it now – brew install apple-gcc42 and sudo ln -s /usr/local/bin/gcc-4.2 /usr/bin/gcc-4.2
$ brew install apple-gcc42
Reference:
$ brew install mysql
Set MySQL server to start on startup
$ mkdir -p ~/Library/LaunchAgents
$ cp /usr/local/Cellar/mysql/5.6.14/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Secure it and give you the option of removing the test databases and anonymous user created by default.
$ /usr/local/opt/mysql51/bin/mysql_secure_installation
To start and stop mysql using System Preferences, download the latest version of MySQL from the official site. Open up the .dmg
file. Drag and drop MySQL.prefPane
onto System Preferences. Follow the directions in the Stack Overflow thread. Basically you'll need to create a symbolic link and set the data directory to a specific user/group.
$ mkdir -p /usr/local/mysql
$ cd /usr/local/mysql
$ ln -s $(brew --prefix mysql)/* .
$ chown -R _mysql:wheel /usr/local/var/mysql
For a nice GUI download and use Sequel Pro.
$ brew install postgresql
A Mac OS X System Preferences pane for controlling the PostgreSQL Database Server.
https://github.com/mckenfra/postgresql-mac-preferences
$ brew install imagemagick
$ identify -version
ersion: ImageMagick 6.8.7-0 2013-10-28 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC
Delegates: bzlib freetype jng jpeg ltdl png png xml zlib
Install RVM with a Ruby (latest will be Ruby 2, but you may specify):
$ \curl -L https://get.rvm.io | bash -s stable --ruby
To start using RVM you need to run source /Users/chriskk/.rvm/scripts/rvm
.
After Ruby 2 is installed, install the latest Ruby 1.9.3:
$ rvm install 1.9.3
If you wish to use RVM in an interactive fashion in other shells then place the following line at the end of your shell's loading files (.bashrc or .bash_profile for bash and .zshenv for zsh), after all PATH/variable settings:
$ vim ~/.localrc
# Loads RVM into a shell session
[[ -s "/Users/chriskk/.rvm/scripts/rvm" ]] && source "/Users/chriskk/.rvm/scripts/rvm"
References: