Install Latest Stable Version of Ruby Using rbenv

后端 未结 6 916
星月不相逢
星月不相逢 2020-12-24 02:07

I want to install the latest stable version of Ruby available with rbenv. This feature won\'t be happening in rbenv itself.

When I run the command rbenv instal

6条回答
  •  执笔经年
    2020-12-24 02:33

    After quite a bit of trial-and-error I figured out a way to grab the latest stable version from this list. This isn't perfect as it just grabs the correct pattern and the last version of it, but it should get the job done. It will work as long as the versions are in order.

    This will produce 2.2.2

    rbenv install -l | grep -P "^  [[:digit:]]\.[[:digit:]]\.[[:digit:]]$" | tail -1
    

    We can plug that result into rbenv install like this:

    rbenv install $(rbenv install -l | grep -P "^  [[:digit:]]\.[[:digit:]]\.[[:digit:]]$" | tail -1)
    

提交回复
热议问题