7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Mavericksにhomebrewでrbenv + Rails環境を構築

Last updated at Posted at 2014-05-06

OSX 10.9でRails環境を構築したのでメモ

事前準備

~/.zshrc
# for rbenv
if [ -d $HOME/.rbenv ]; then
	eval "$(rbenv init -)"
fi

# for homebrew
export PATH=/usr/local/bin:$PATH

homebrewでツールをインストール

brew update
brew upgrade
brew install openssl
brew install readline
brew install rbenv
brew install ruby-build
# お好みで
brew install postgresql
brew cleanup

opensslのpathを追加

brew install opensslだけだと

which openssl
# /usr/bin/openssl

になってるので,

brew link openssl --force
source ~/.zshrc
which openssl
# /usr/local/bin/openssl

とする.

rbenvでruby2.1.1をインストール

rbenv install 2.1.1 だとインストールできないので, readline 6.3環境でRuby 2.1.1をインストールするpatchを利用させていただく.

curl -sSL https://gist.github.com/mislav/a18b9d7f0dc5b9efc162.txt | env CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" rbenv install --patch 2.1.1
rbenv global 2.1.1
rbenv version
# 2.1.1 (set by $HOME/.rbenv/version)
which ruby
# $HOME/.rbenv/versions/2.1.1/bin/ruby

bundlerをインストール

gem install bundler --no-ri --no-rdoc
which bundle
# Users/yyama/.rbenv/shims/bundle

あとは適当なRailsプロジェクトでbundle installする.

7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?