How to update Ruby with Homebrew?

前端 未结 5 2044
一生所求
一生所求 2020-12-22 18:27

I want to know how to update to the latest stable version of Ruby with Homebrew. I am not interested in using RVM. Thanks.

相关标签:
5条回答
  • 2020-12-22 18:29

    I would use ruby-build with rbenv. The following lines install Ruby 2.7.2 and set it as your default Ruby version:

    $ brew update
    $ brew install ruby-build
    $ brew install rbenv
    
    $ rbenv install 2.7.2
    $ rbenv global 2.7.2
    
    0 讨论(0)
  • 2020-12-22 18:35

    open terminal

    \curl -sSL https://get.rvm.io | bash -s stable

    restart terminal then

    rvm install ruby-2.4.2
    

    check ruby version it should be 2.4.2

    0 讨论(0)
  • 2020-12-22 18:41

    brew upgrade ruby

    Should pull latest version of the package and install it.

    brew update updates brew itself, not packages (formulas they call it)

    0 讨论(0)
  • 2020-12-22 18:49

    Adding to the selected answer (as I haven't enough rep to add comment), one way to see the list of available versions (from ref) try:

    $ rbenv install -l
    
    0 讨论(0)
  • 2020-12-22 18:52

    To upgrade Ruby with rbenv: Per the rbenv README

    • Update first: brew upgrade rbenv ruby-build
    • See list of Ruby versions: versions available: rbenv install -l
    • Install: rbenv install <selected version>
    0 讨论(0)
提交回复
热议问题