# 安装所需要的库
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev nodejs mysql-client libmysqlclient-dev git htop
# 安装RVM
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable
source /home/ubuntu/.rvm/scripts/rvm
# 安装Ruby,使用ruby-china镜像加速
echo "ruby_url=https://cache.ruby-china.org/pub/ruby" > ~/.rvm/user/db
rvm requirements
rvm install 2.3.1 --disable-binary
rvm use 2.3.1 --default
# 安装bundler,更改ruby源为ruby-china加速镜像
gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
gem install bundler