1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

rbenvでruby3.0.0をインストールする

Posted at

結論:実行したコマンド

$ brew upgrade rbenv ruby-build
$ rbenv install 3.0.0
$ rbenv local 3.0.0

ログ(brew upgrade rbenv ruby-build)

# {username}@MacBook-Pro:~$ brew upgrade rbenv ruby-build
Error:
  homebrew-core is a shallow clone.
  homebrew-cask is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
These commands may take a few minutes to run due to the large size of the repositories.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!
Warning: rbenv 1.1.2 already installed
==> Upgrading 1 outdated package:
ruby-build 20190401 -> 20210119
==> Upgrading ruby-build 20190401 -> 20210119
==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.29.2_3.catalina.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/80f141e695f73bd058fd82e9f539dc67471666ff6800c5e280b5af7d3050f435?response-content-disposition=attachment%3Bfilename%3D%22pkg-config-0.29.2_3.catalina.bottle.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbe
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/readline-8.1.catalina.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/fe4de019cf549376a7743dcb0c86db8a08ca2b6d0dd2f8cb796dd7cf973dc2e9?response-content-disposition=attachment%3Bfilename%3D%22readline-8.1.catalina.bottle.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNv
######################################################################## 100.0%
==> Downloading https://github.com/rbenv/ruby-build/archive/v20210119.tar.gz
==> Downloading from https://codeload.github.com/rbenv/ruby-build/tar.gz/v20210119
######################################################################## 100.0%
==> Installing dependencies for ruby-build: pkg-config and readline
==> Installing ruby-build dependency: pkg-config
==> Pouring pkg-config-0.29.2_3.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/pkg-config/0.29.2_3: 11 files, 623.8KB
==> Installing ruby-build dependency: readline
==> Pouring readline-8.1.catalina.bottle.tar.gz
==> Caveats
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BSD libedit.

For compilers to find readline you may need to set:
  export LDFLAGS="-L/usr/local/opt/readline/lib"
  export CPPFLAGS="-I/usr/local/opt/readline/include"

For pkg-config to find readline you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig"

==> Summary
🍺  /usr/local/Cellar/readline/8.1: 48 files, 1.6MB
==> Installing ruby-build
==> ./install.sh
==> Caveats
ruby-build installs a non-Homebrew OpenSSL for each Ruby version installed and these are never upgraded.

To link Rubies to Homebrew's OpenSSL 1.1 (which is upgraded) add the following
to your /Users/#{username}/.bash_profile:
  export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)"

Note: this may interfere with building old versions of Ruby (e.g <2.4) that use
OpenSSL <1.1.
==> Summary
🍺  /usr/local/Cellar/ruby-build/20210119: 520 files, 259.9KB, built in 3 seconds
Removing: /usr/local/Cellar/ruby-build/20190401... (441 files, 221.2KB)
==> Upgrading 6 dependents:
postgresql 11.3 -> 13.1, pyenv 1.2.9 -> 1.2.22, sqlite 3.31.1 -> 3.34.0, python@3.9 3.9.1_7, ruby 2.7.0 -> 3.0.0_1, vim 8.2.0400 -> 8.2.2450
==> Upgrading sqlite 3.31.1 -> 3.34.0
==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.34.0.catalina.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/7e04c1fcd0294ec7625e43eea05714d8bb4d15d24675c99484f1403fdcb438ec?response-content-disposition=attachment%3Bfilename%3D%22sqlite-3.34.0.catalina.bottle.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXN
######################################################################## 100.0%
==> Pouring sqlite-3.34.0.catalina.bottle.tar.gz
==> Caveats
sqlite is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have sqlite first in your PATH, run:
  echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> /Users/#{username}/.bash_profile

For compilers to find sqlite you may need to set:
  export LDFLAGS="-L/usr/local/opt/sqlite/lib"
  export CPPFLAGS="-I/usr/local/opt/sqlite/include"

For pkg-config to find sqlite you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/sqlite/lib/pkgconfig"

==> Summary
🍺  /usr/local/Cellar/sqlite/3.34.0: 11 files, 4.1MB
Removing: /usr/local/Cellar/sqlite/3.31.1... (11 files, 4MB)
==> Upgrading ruby 2.7.0 -> 3.0.0_1
==> Downloading https://homebrew.bintray.com/bottles/libyaml-0.2.5.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/openssl%401.1-1.1.1i.catalina.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/066b9f114617872e77fa3d4afee2337daabc2c181d7564fe60a5b26d89d69742?response-content-disposition=attachment%3Bfilename%3D%22openssl%401.1-1.1.1i.catalina.bottle.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBb
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/ruby-3.0.0_1.catalina.bottle.1.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/b869f4edd6b14d7c54e8994d77b5d92f935ca67c746babbda910471de21ac6aa?response-content-disposition=attachment%3Bfilename%3D%22ruby-3.0.0_1.catalina.bottle.1.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZX
######################################################################## 100.0%
==> Installing dependencies for ruby: libyaml and openssl@1.1
==> Installing ruby dependency: libyaml
==> Pouring libyaml-0.2.5.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/libyaml/0.2.5: 10 files, 323.6KB
==> Installing ruby dependency: openssl@1.1
==> Pouring openssl@1.1-1.1.1i.catalina.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/openssl@1.1/certs

and run
  /usr/local/opt/openssl@1.1/bin/c_rehash

openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.

If you need to have openssl@1.1 first in your PATH, run:
  echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> /Users/#{username}/.bash_profile

For compilers to find openssl@1.1 you may need to set:
  export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
  export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"

For pkg-config to find openssl@1.1 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"

==> Summary
🍺  /usr/local/Cellar/openssl@1.1/1.1.1i: 8,067 files, 18.5MB
==> Installing ruby
==> Pouring ruby-3.0.0_1.catalina.bottle.1.tar.gz
==> Caveats
By default, binaries installed by gem will be placed into:
  /usr/local/lib/ruby/gems/3.0.0/bin

You may want to add this to your PATH.

ruby is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have ruby first in your PATH, run:
  echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> /Users/#{username}/.bash_profile

For compilers to find ruby you may need to set:
  export LDFLAGS="-L/usr/local/opt/ruby/lib"
  export CPPFLAGS="-I/usr/local/opt/ruby/include"

For pkg-config to find ruby you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/ruby/lib/pkgconfig"

==> Summary
🍺  /usr/local/Cellar/ruby/3.0.0_1: 16,314 files, 37.6MB
Removing: /usr/local/Cellar/ruby/2.7.0... (20,346 files, 32.8MB)
==> Upgrading postgresql 11.3 -> 13.1
==> Downloading https://homebrew.bintray.com/bottles/icu4c-67.1.catalina.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/2d1e91b5127f66e7941790c004817c94c892725c88f84f1e4c37297fcbc0c72f?response-content-disposition=attachment%3Bfilename%3D%22icu4c-67.1.catalina.bottle.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdX
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/krb5-1.18.3.catalina.bottle.1.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/67f67b210947e2bd62d974b2494f1192f169fae35605f38f7b2f0a9a73eb0633?response-content-disposition=attachment%3Bfilename%3D%22krb5-1.18.3.catalina.bottle.1.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXN
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/postgresql-13.1.catalina.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/13939e578f0a48c78966c2527dc48391b19650b51f7489767b5237e3bab16793?response-content-disposition=attachment%3Bfilename%3D%22postgresql-13.1.catalina.bottle.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZ
######################################################################## 100.0%
==> Installing dependencies for postgresql: icu4c and krb5
==> Installing postgresql dependency: icu4c
==> Pouring icu4c-67.1.catalina.bottle.tar.gz
==> Caveats
icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).

If you need to have icu4c first in your PATH, run:
  echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> /Users/#{username}/.bash_profile
  echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> /Users/#{username}/.bash_profile

For compilers to find icu4c you may need to set:
  export LDFLAGS="-L/usr/local/opt/icu4c/lib"
  export CPPFLAGS="-I/usr/local/opt/icu4c/include"

For pkg-config to find icu4c you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"

==> Summary
🍺  /usr/local/Cellar/icu4c/67.1: 258 files, 71.2MB
==> Installing postgresql dependency: krb5
==> Pouring krb5-1.18.3.catalina.bottle.1.tar.gz
==> Caveats
krb5 is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have krb5 first in your PATH, run:
  echo 'export PATH="/usr/local/opt/krb5/bin:$PATH"' >> /Users/#{username}/.bash_profile
  echo 'export PATH="/usr/local/opt/krb5/sbin:$PATH"' >> /Users/#{username}/.bash_profile

For compilers to find krb5 you may need to set:
  export LDFLAGS="-L/usr/local/opt/krb5/lib"
  export CPPFLAGS="-I/usr/local/opt/krb5/include"

For pkg-config to find krb5 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/krb5/lib/pkgconfig"

==> Summary
🍺  /usr/local/Cellar/krb5/1.18.3: 162 files, 5.2MB
==> Installing postgresql
==> Pouring postgresql-13.1.catalina.bottle.tar.gz
==> Caveats
To migrate existing data from a previous major version of PostgreSQL run:
  brew postgresql-upgrade-database

This formula has created a default database cluster with:
  initdb --locale=C -E UTF-8 /usr/local/var/postgres
For more details, read:
  https://www.postgresql.org/docs/13/app-initdb.html

To have launchd start postgresql now and restart at login:
  brew services start postgresql
Or, if you don't want/need a background service you can just run:
  pg_ctl -D /usr/local/var/postgres start
==> Summary
🍺  /usr/local/Cellar/postgresql/13.1: 3,217 files, 42.6MB
Removing: /usr/local/Cellar/postgresql/11.3... (3,187 files, 35.4MB)
==> Upgrading pyenv 1.2.9 -> 1.2.22
==> Downloading https://homebrew.bintray.com/bottles/pyenv-1.2.22.catalina.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/b4f3038e29acde1d99579104ae100777621b9716fe797e7917dad1e9795d3473?response-content-disposition=attachment%3Bfilename%3D%22pyenv-1.2.22.catalina.bottle.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNv
######################################################################## 100.0%
==> Pouring pyenv-1.2.22.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/pyenv/1.2.22: 721 files, 2.6MB
Removing: /usr/local/Cellar/pyenv/1.2.9... (619 files, 2.4MB)
==> Upgrading python@3.9 -> 3.9.1_7
==> Downloading https://homebrew.bintray.com/bottles/gdbm-1.18.1_1.catalina.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/f7b5ab7363961fa6defcb66b4ffdf5365264fcb97d35bc413e754f173a3b1912?response-content-disposition=attachment%3Bfilename%3D%22gdbm-1.18.1_1.catalina.bottle.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXN
######################################################################## 100.0%
==> Downloading https://homebrew.bintray.com/bottles/tcl-tk-8.6.11.catalina.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/5bc2306be500fe9eba4df65215a7322196260c91864095591216b442d62dfccf?response-content-disposition=attachment%3Bfilename%3D%22tcl-tk-8.6.11.catalina.bottle.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXN
######################################################################## 100.0%
Warning: Building python@3.9 from source:
  The bottle needs the Apple Command Line Tools to be installed.
  You can install them, if desired, with:
    xcode-select --install

==> Downloading https://files.pythonhosted.org/packages/84/48/5c99d8770fd0a9eb0f82654c3294aad6d0ba9f8600638c2e2ad74f2c5d52/setuptools-52.0.0.tar.gz
######################################################################## 100.0%
==> Downloading https://files.pythonhosted.org/packages/b7/2d/ad02de84a4c9fd3b1958dc9fb72764de1aa2605a9d7e943837be6ad82337/pip-21.0.1.tar.gz
######################################################################## 100.0%
==> Downloading https://files.pythonhosted.org/packages/ed/46/e298a50dde405e1c202e316fa6a3015ff9288423661d7ea5e8f22f589071/wheel-0.36.2.tar.gz
######################################################################## 100.0%
==> Downloading https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tar.xz
######################################################################## 100.0%
Error: Xcode alone is not sufficient on Catalina.
Install the Command Line Tools:
  xcode-select --install

# {username}@MacBook-Pro:~$ rbenv install --list
2.5.8
2.6.6
2.7.2
3.0.0
jruby-9.2.14.0
mruby-2.1.2
rbx-5.0
truffleruby-21.0.0
truffleruby+graalvm-21.0.0

Only latest stable releases for each Ruby implementation are shown.
Use 'rbenv install --list-all / -L' to show all local versions.

ログ(rbenv install 3.0.0)時間かかるので注意

# {username}@MacBook-Pro:~$ rbenv install 3.0.0
Downloading openssl-1.1.1i.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242
Installing openssl-1.1.1i...
Installed openssl-1.1.1i to /Users/#{username}/.rbenv/versions/3.0.0

Downloading ruby-3.0.0.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.0.tar.gz
Installing ruby-3.0.0...
ruby-build: using readline from homebrew
Installed ruby-3.0.0 to /Users/#{username}/.rbenv/versions/3.0.0

バージョン確認

# {username}@MacBook-Pro:~$ rbenv local 3.0.0
# {username}@MacBook-Pro:~$ ruby -v
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19]
# {username}@MacBook-Pro:~$ rbenv versions
  system
  2.3.1
  2.4.0
  2.4.1
  2.5.1
  2.5.3
  2.5.5
  2.6.0
  2.6.2
* 3.0.0 (set by /Users/#{username}/.ruby-version)

参考記事(いつもありがとうございます)

rbenv/ruby-build

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?