Skip to content

Instantly share code, notes, and snippets.

@zhangjianyu1979
Forked from sr75/osx-homebrew-setup.md
Last active August 29, 2015 14:21
Show Gist options
  • Save zhangjianyu1979/182d253d923a2e137382 to your computer and use it in GitHub Desktop.
Save zhangjianyu1979/182d253d923a2e137382 to your computer and use it in GitHub Desktop.

Mac Homebrew (RVM/MySQL/Redis) setup

Follow the steps below to setup a local development environment:

XQuartz

Recommended to download latest XQuartz

iTerm2

Recommended to download iTerm2 and use in place of the default Terminal.app that comes with OSX.

Xcode

First you'll need to install Xcode from the App Store.

After Xcode is installed you can proceed with the following terminal commands:

sudo xcodebuild -license
sudo xcode-select --install ## not needed, if you've updated/installed latest XCode

Homebrew

Homebrew permissions needed:

## (Change the group of homebrew installation directory)
sudo chgrp -R admin /usr/local
## (Allow group members to write inside this directory)
sudo chmod -R g+w /usr/local
## (Create homebrew cache directory)
sudo mkdir -p /Library/Caches/Homebrew
## (Change the group of homebrew cache directory)
sudo chgrp -R admin /Library/Caches/Homebrew
## (Allow group members to write inside this directory)
sudo chmod -R g+w /Library/Caches/Homebrew

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install the following:

brew install bash-completion
brew install git
brew tap homebrew/dupes
brew install libxml2 libxslt libiconv autoconf automake libtool \
pkg-config libyaml readline libksba openssl
curl -L https://get.rvm.io | bash -s stable
# close terminal sessions, create a new terminal session then...
rvm autolibs homebrew
rvm requirements
brew update && brew upgrade && brew cleanup --force && brew prune && brew doctor

Ready to brew?

If no errors, you may want to install these:

brew install autoconf automake bash-completion cmake \
gmp4 htop-osx imagemagick jpeg \
libgpg-error libiconv libksba libpng libtool libxml2 \
libxslt libyaml mpfr2 node openssl \
readline tree
## memcached
brew install libevent memcached

Graphviz

brew install gts librsvg freetype
brew install graphviz --with-bindings --with-freetype --with-librsvg --with-pangocairo

MySQL

Setup/Configure mysql:

brew install mysql
brew info mysql
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

Test connection:

mysql -uroot

Redis

Setup/Configure redis:

brew install redis
brew info redis
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment