Skip to content

macOS での環境構築

cloudliner edited this page Oct 26, 2016 · 10 revisions

概要

仮想環境を起動させるのが面倒な人へ。 手順はおおよそです。。。

ポイント

  • 必要なソフトウェアは Heroku 以外 Homebrew でインストール可能
  • Ruby のバージョンを合わせるのが重要

手順

Ruby

  1. Homebrewrbenv をインストールする
  2. rbenv で、特定のバージョン(2.2.5)の ruby をインストールする

PostgreSQL

.travis.yml に書いてある PostgreSQL のバージョンが 9.3 で、Vagrant のローカル環境は 9.4.8 で、Heroku は 9.5.4 なので、バージョンを合わせるのはやめました

  1. PostgreSQL をインストールする
$ brew install postgresql
  1. ここ を参考にして、PostgreSQL の起動・停止を行う
  • 起動
$ brew services start postgresql
  • 停止
$ brew services stop postgresql
  • 状態確認
$ brew services list

Git

最新のインストール

  1. Homebrew でインストールする

自動補完・ブランチ表示の設定

  1. ここを参考にして、git-completion と git-prompt を有効にするために、~/.bash_profile を編集して次の行を追加する
## Git
# Read script
source /usr/local/etc/bash_completion.d/git-completion.bash
source /usr/local/etc/bash_completion.d/git-prompt.sh

# Show information to prompt
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWUPSTREAM=1
GIT_PS1_SHOWUNTRACKEDFILES=
GIT_PS1_SHOWSTASHSTATE=1

# Terminal
export PS1='\h:\W \u\[\033[1;30m\]$(__git_ps1)\[\033[0m\] \$ '

Heroku