当然可以避免在Linux上安装Ruby的困难
sudo apt update
sudo apt install ruby
sudo apt install -y build-essential libssl-dev zlib1g-dev libreadline-dev libxml2-dev libyaml-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python libpq-dev
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
rbenv install 2.7.4
遵循这些建议,你应该能够避免在Linux上安装Ruby时遇到的困难。