Ruby 3.0.0 Preview 1 has been released. https://www.ruby-lang.org/en/news/2020/09/25/ruby-3-0-0-preview1-released/
Refer to the following https://github.com/rbenv/ruby-build#upgrading
brew update && brew upgrade ruby-build
$ rbenv install --list
2.5.8
2.6.6
2.7.1
jruby-9.2.13.0
maglev-1.0.0
mruby-2.1.2
rbx-5.0
truffleruby-20.2.0
truffleruby+graalvm-20.2.0
Only latest stable releases for each Ruby implementation are shown.
Use 'rbenv install --list-all' to show all local versions.
Only stable and latest ones are available, so check with --list-all
$ rbenv install --list-all | grep 3.0.0-preview1
3.0.0-preview1
there were.
$ rbenv install 3.0.0-preview1
$ rbenv versions
system
2.6.1
2.7.0
* 2.7.1 (set by /Users/soul/.rbenv/version)
3.0.0-preview1
#System-wide 3.0.0-Use preview1
rbenv global 3.0.0-preview1
#Version confirmation
ruby -v
ruby 3.0.0preview1 (2020-09-25 master 0096d2b895) [x86_64-darwin19]
irb(main):001:0> RUBY_VERSION
#=> "3.0.0"
require 'prime'
#=> true
#Right assignment introduced in Ruby3
Prime.find {|p| p > 10000} => x
#=> 10007
x
#=> 10007
The right substitution notation added in Ruby3 can be used.
Recommended Posts