ruby環境搭建記錄

ruby 環境搭建

Author : Janloong Do_O

rvm 安裝

導入安全公鑰
curl -sSL https://rvm.io/mpapis.asc | sudo gpg2 --import -

安裝穩定版本 定位在需要安裝的目錄下
curl -sSL https://get.rvm.io | sudo bash -s stable

etc/profile配置path路徑

ruby安裝

rvm install ruby --default

如果報錯page404 需要更新list
需要先執行
rvm autolibs disable

參考ruby-china的推薦安裝方式 傳送門

echo "Install RVM"
echo "---------------------------------------------------------------------------"
command gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
command curl -L https://get.rvm.io | bash -s stable
if [ whoami = 'root']; then
command source /etc/profile.d/rvm.sh
else
command source ~/.rvm/scripts/rvm
fi

if [ MIRROR = '1' ]; then
echo "ruby_url=https://cache.ruby-china.org/pub/ruby" > ~/.rvm/user/db
fi

rvm requirements
rvm install 2.3.1 --disable-binary
rvm use 2.3.1 --default
rvm -v
ruby -v

if [ MIRROR = '1' ]; then
gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
fi

gem install bundler
bundle -v
echo "--------------------------- Install Successed -----------------------------"
發佈了50 篇原創文章 · 獲贊 2 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章