lundi 5 décembre 2022

Why can't I install ruby 3.1.2 in linux?

I tried:

if ! command -v ruby &> /dev/null
then
    # - proverbot's version
    # First, install Ruby, as that is for some reason required to build
    # the "system" project
#    git clone https://github.com/rbenv/ruby-build.git ~/ruby-build
#    mkdir -p ~/.local
#    PREFIX=~/.local ./ruby-build/install.sh
#    ~/.local/ruby-build 3.1.2 ~/.local/

    # - u-pycoq's version
#    sudo apt-get install ruby-full
    sudo apt-get install rbenv
    rbenv init
    eval "$(rbenv init - bash)"
    echo 'eval "$(rbenv init - bash)"' >> ~/.bashrc

    sudo apt-get install ruby-build
#    ruby-build 3.1.2
    rbenv install 3.1.2

    rbenv global 3.1.2
    ruby -v

else
    echo "Error: failed to install ruby"
fi

but I get my ruby build is not up to date perhaps but when I install it -- it is up to date. Therefore, why is the proverbot's attempt 3.1.2 if it doesn't exist?

inspired from: https://superuser.com/questions/340490/how-to-install-and-use-different-versions-of-ruby

Aucun commentaire:

Enregistrer un commentaire