手動安裝rbenv

git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
# 用來編譯安裝 ruby
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
# 用來管理 gemset, 可選, 因為有 bundler 也沒什麽必要
git clone git://github.com/jamis/rbenv-gemset.git  ~/.rbenv/plugins/rbenv-gemset
# 通過 gem 命令安裝完 gem 後無需手動輸入 rbenv rehash 命令
git clone git://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
# 通過 rbenv update 命令來更新 rbenv 以及所有插件
git clone git://github.com/rkh/rbenv-update.git ~/.rbenv/plugins/rbenv-update
# 使用 Ruby China 的鏡像安裝 Ruby
git clone git://github.com/AndorChen/rbenv-china-mirror.git ~/.rbenv/plugins/rbenv-china-mirror

.zshrc添加

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

source .zshrc或者直接restart Terminal

References Ruby China Wiki

你可能感兴趣的:(手動安裝rbenv)