Install Ruby 3.0.0 Preview 1 with a combination of Homebrew and rbenv

background

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/

Try to install

First thing I did

Refer to the following https://github.com/rbenv/ruby-build#upgrading

brew update && brew upgrade ruby-build

Check the installable Ruby

$ 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.

Ruby 3.0.0 Preview 1 installation

$ rbenv install 3.0.0-preview1

Installation confirmation

$ rbenv versions
  system
  2.6.1
  2.7.0
* 2.7.1 (set by /Users/soul/.rbenv/version)
  3.0.0-preview1

Specify Ruby version to be used in rbenv

#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]

Verification

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

Install Ruby 3.0.0 Preview 1 with a combination of Homebrew and rbenv
Install rbenv with apt on ubuntu and put ruby
Impressions and memories of openssl, curl, ruby, homebrew, rbenv installation
Install ruby on Ubuntu 20.04 with rbenv
How to deal with different versions of rbenv and Ruby
Extract a part of a string with Ruby
Try writing "Hello, World" with a combination of various languages and libraries
[Ruby] Arguments with keywords and default values of arguments
Manage the version of Ruby itself with rbenv
Install java with Homebrew
Install Ruby 3.0.0 with asdf
[Ruby] I made a crawler with anemone and nokogiri.
Install Ruby 3.0.0-preview1 on macOS (also without Homebrew ruby-build)
Ruby version switching with rbenv
Install Java 7 with Homebrew (cask)
Combination of search and each_with_index
Install Java and Tomcat with Ansible
Install rbenv with apt on ubuntu and put ruby
How to install Gradle and Kotlin with SDKMAN (Mac)
Install java with Homebrew
Install Ruby 3.0.0 with asdf
Install and configure Keycloak
Install Gradle with ubuntu16.04
Install buildah and container-selinux
Install Composer with Docker
[PHP8] Install and use PECL YAML function (YAML parser) with Docker
Install Ruby 3.0.0 Preview 1 with a combination of Homebrew and rbenv
Install gem in Serverless Framework and AWS Lambda with Ruby environment
[Illustration] Finding the sum of coins with a recursive function [Ruby]
Install Ruby on MSYS2 with pacman
Install Java and Tomcat with Ansible
A memorandum of personal phpenv install
Impressions of making BlackJack-cli with Ruby
Make a typing game with ruby
Make a daily build of the TOPPERS kernel with Gitlab and Docker
Minimal steps to set up a Ruby environment with rbenv on Ubuntu 20.04
With ruby ● × Game and Othello (basic review)
A brief summary of DI and DI containers
Make a note of Ruby keyword arguments
Install Docker Desktop for Mac with Homebrew
Explanation of Ruby Time and Date objects
Summary of hashes and symbols in Ruby
Draw a graph with Sinatra and Chartkick
Let's make a smart home with Ruby!
I made a risky die with Ruby
Comparison of JavaScript objects and Ruby classes
Sort an array of Ruby homebrew classes
Convert JSON to TSV and TSV to JSON with Ruby
Get a list of Qiita articles for a specific user with Ruby + Qiita API v2