下载 Ruby 2.7 安装包:http://www.ruby-lang.org/en/downloads/

    1. $ tar -xvf ruby-2.7.4.tar.gz
    2. $ cd ruby-2.7.4/
    3. $ sudo ./configure --prefix=/usr/local/ruby
    4. $ sudo make
    5. $ sudo make install
    6. $ sudo apt install -y ruby-dev

    添加环境变量:

    1. export PATH="/usr/local/ruby/bin:$PATH"