G
Published on
· Last modified on
· Public

Mac OS X 开发环境配置

​用于 ruby 和 java 开发的 Mac OS X 环境

  • 安装 xcode

安装 Xcode command line tools

xcode-select --install

  • 安装 homebrew

    ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"

  • 安装 git

    brew install git

    设置 git 用户

    $ git config --global user.name "username"
    $ git config --global user.email "username@email.com"
    
  • 安装 ruby

    • 安装 rbenv

      brew update
      brew install rbenv ruby-build rbenv-gem-rehash rbenv-default-gems
      

      更新 brew upgrade rbenv ruby-build rbenv-gem-rehash rbenv-default-gems

      配置环境变量

      echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
      echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
      
    • 安装 ruby

      rbenv install 2.2.0
      rbenv rehash
      rbenv global 2.2.0
      
    • 安装 bundler & rails

      gem install bundler rails --no-ri --no-rdoc

  • 安装 oh-my-zsh

curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh

  • 配置 sublime text

sublime text 2

ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl

sublime text 3

ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl

  • 安装 java

从 Oracle 网站下载相应版本 JDK 安装 设置 JAVAHOME (~/.bashprofile 或者 ~/.zshrc)

export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=$JAVA_HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH
  • 安装 mysql

brew install mysql

  • 安装 iTerm2

  • 安装 eclipse

S
Published on

星一下,求星,有了 Mac 再看...

V
Published on

已赞,推荐可以看看我的这篇:http://voidy.net/the_guide_for_mac/

M
Published on

已星,求赞,点我的昵称就好啦

B
Published on

已星,求星

Sign in or Sign up Leave Comment