標籤:
rbenv非常好用,但有一個小問題,每個使用者都需要單獨安裝和設定版本。下面安裝步驟可以安裝在/usr/local/rbenv下,所有使用者都可以共用rbenv。 #rbenv安裝(/usr/local/rbenv)#安裝依賴,需要root使用者yum install -y gityum install -y readline-develyum install -y openssl-devel zlib-develyum install -y postgresql-devel#關閉ssl驗證,如果clone報ca錯誤,執行下面的即可#git config --global http.sslVerify falsegit clone https://github.com/sstephenson/rbenv.git /usr/local/rbenvecho ‘export RBENV_ROOT=/usr/local/rbenv‘>/etc/profile.d/rbenv.shecho ‘export PATH="$RBENV_ROOT/bin:$PATH"‘>/etc/profile.d/rbenv.shecho ‘eval "$(rbenv init -)"‘>>/etc/profile.d/rbenv.shgit clone https://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build#重新載入profilesource ~/.bash_profile#查看可用ruby版本rbenv install --list#安裝某一版本rbenv install 2.1.5rbenv global 2.1.5#使用國內gem源gem sources --remove https://rubygems.org/gem sources -a http://ruby.sdutlinux.org/gem sources -lgem install bundle -V
用rbenv給整個系統安裝ruby(所有使用者都可用)