原因是测试环境崩了。所以需要搭建一套本地的环境用于测试。看了rvm的官网安装方法,发现不行。
1. 下载rvm包
https://github.com/rvm/rvm/tags
下载后解压缩。tar -xzvf xxx
解压在root目录下。
这里碰到一个坑:
需要声明下rvm_scripts_path变量。
- 在/etc/profile或其他配置文件中添加
export rvm_scripts_path='/root/rvm/scripts' #你的解压后的目录。我这里重命名了下。
- source下
source /etc/profile
- 安装rvm
bash /root/install --auto-dotfiles && source /root/rvm/scripts/rvm
- 查看
rvm -v
- 因为可能因为缺少目录,无法安装ruby
mkdir /root/rvm/rubies
mkdir /root/rvm/src
mkdir /root/rvm/archives
- 安装ruby和bundler
我这里安装ruby版本2.5.1
rvm install 2.5.1
rvm use 2.5.1
gem install bundler
gem update --system
gem sources --add https://gems.ruby-china.com --remove https://rubygems.org/