下载 Ruby 2.7 安装包:http://www.ruby-lang.org/en/downloads/
$ tar -xvf ruby-2.7.4.tar.gz
$ cd ruby-2.7.4/
$ sudo ./configure --prefix=/usr/local/ruby
$ sudo make
$ sudo make install
$ sudo apt install -y ruby-dev
添加环境变量:
export PATH="/usr/local/ruby/bin:$PATH"