Mac Ruby Install - kapilpipaliya/ruby_notes GitHub Wiki

Mac Ruby Install:

% brew install rbenv ruby-build
==> Downloading https://ghcr.io/v2/homebrew/core/m4/manifests/1.4.18-1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/m4/blobs/sha256:1db2471add366dde3b52f8d2d32e6d118584f91d1390d8efd6c10c41c9d6a45c
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:1db2471add366dde3b52f8d2d32e6d118584f91d1390d8efd6c10c41c9d6a45c?se=2021-06-20T16%3A05%3A00Z&sig=VtMa1x6cnbaUVoDfbnBa
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/autoconf/manifests/2.71
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/autoconf/blobs/sha256:6279cc6294da77a87b2e08783f39a97e8678bde9b3e2899685879cabee6d2945
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:6279cc6294da77a87b2e08783f39a97e8678bde9b3e2899685879cabee6d2945?se=2021-06-20T16%3A05%3A00Z&sig=%2F44x9q99uSZGXycdzU
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/pkg-config/manifests/0.29.2_3
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/pkg-config/blobs/sha256:ffd4491f62201d14b7eca6beff954a2ab265351589cd5b3b79b8bbb414485574
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:ffd4491f62201d14b7eca6beff954a2ab265351589cd5b3b79b8bbb414485574?se=2021-06-20T16%3A05%3A00Z&sig=aPBYgSbVOddGyByK29Sn
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/ruby-build/manifests/20210611
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/ruby-build/blobs/sha256:6ff77bcf5c3f8bf14719f438427e6250f2ec387775ab0d5dd3d7e896c4caaf1d
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:6ff77bcf5c3f8bf14719f438427e6250f2ec387775ab0d5dd3d7e896c4caaf1d?se=2021-06-20T16%3A05%3A00Z&sig=h%2F7zjwkaBiaItcTlvB
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/rbenv/manifests/1.1.2
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/rbenv/blobs/sha256:19d0b9e3b11bcacdf692e78248c1b5764f7d3f4b58f2b83ad7b39562863ba82e
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:19d0b9e3b11bcacdf692e78248c1b5764f7d3f4b58f2b83ad7b39562863ba82e?se=2021-06-20T16%3A05%3A00Z&sig=bGpG8annWVZPsTz1Duim
######################################################################## 100.0%
==> Installing dependencies for rbenv: m4, autoconf, pkg-config and ruby-build
==> Installing rbenv dependency: m4
==> Pouring m4--1.4.18.arm64_big_sur.bottle.1.tar.gz
🍺  /opt/homebrew/Cellar/m4/1.4.18: 13 files, 658KB
==> Installing rbenv dependency: autoconf
==> Pouring autoconf--2.71.arm64_big_sur.bottle.tar.gz
🍺  /opt/homebrew/Cellar/autoconf/2.71: 71 files, 3.2MB
==> Installing rbenv dependency: pkg-config
==> Pouring pkg-config--0.29.2_3.arm64_big_sur.bottle.tar.gz
🍺  /opt/homebrew/Cellar/pkg-config/0.29.2_3: 11 files, 677.1KB
==> Installing rbenv dependency: ruby-build
==> Pouring ruby-build--20210611.all.bottle.tar.gz
🍺  /opt/homebrew/Cellar/ruby-build/20210611: 532 files, 265KB
==> Installing rbenv
==> Pouring rbenv--1.1.2.arm64_big_sur.bottle.tar.gz
🍺  /opt/homebrew/Cellar/rbenv/1.1.2: 36 files, 124KB

ruby 2.5.0 install failed:

% rbenv install 2.5.0
Downloading openssl-1.1.1k.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5
Installing openssl-1.1.1k...
Installed openssl-1.1.1k to /Users/apple/.rbenv/versions/2.5.0

Downloading ruby-2.5.0.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.0.tar.bz2
Installing ruby-2.5.0...

WARNING: ruby-2.5.0 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.

ruby-build: using readline from homebrew

BUILD FAILED (macOS 11.4 using ruby-build 20210611)

Inspect or clean up the working tree at /var/folders/zv/49stc5114rv600gcsjm9ptv80000gn/T/ruby-build.20210620213138.4594.xb6UyZ
Results logged to /var/folders/zv/49stc5114rv600gcsjm9ptv80000gn/T/ruby-build.20210620213138.4594.log

Last 10 log lines:
    ~~~~~~ ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
compiling ../.././ext/psych/yaml/reader.c
compiling ../.././ext/psych/yaml/emitter.c
compiling ../.././ext/psych/yaml/parser.c
linking shared-object date_core.bundle
5 warnings generated.
linking shared-object zlib.bundle
1 warning generated.
linking shared-object psych.bundle
make: *** [build-ext] Error 2

Note:

try to run ruby -v and check if ruby is already installed. I already have ruby 2.6 installed:

 % ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]

if bundle version not match: https://bundler.io/blog/2019/05/14/solutions-for-cant-find-gem-bundler-with-executable-bundle.html