Skip to content

Instantly share code, notes, and snippets.

@hoanghiep90
Last active February 1, 2023 18:36
Show Gist options
  • Save hoanghiep90/41aa5a147b8ee4ac5c9865ec49b518b8 to your computer and use it in GitHub Desktop.
Save hoanghiep90/41aa5a147b8ee4ac5c9865ec49b518b8 to your computer and use it in GitHub Desktop.
Install Ruby 2.6.10 with rbenv (M1/M2 Mac)

Problem

I ran command install ruby 2.6.10 with rbenv.

rbenv install 2.6.10

Got the error:

☁  rbenv install 2.6.10
To follow progress, use 'tail -f /var/folders/4q/r83_r5397js7n6p3213vsy600000gq/T/ruby-build.20221121154058.35374.log' or pass --verbose
Downloading openssl-1.1.1q.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca
Installing openssl-1.1.1q...
patching file test/v3ext.c
Installed openssl-1.1.1q to /Users/risa.watanabe/.anyenv/envs/rbenv/versions/2.6.10

Downloading ruby-2.6.10.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.10.tar.bz2
Installing ruby-2.6.10...
ruby-build: using readline from homebrew

BUILD FAILED (macOS 12.6 using ruby-build 20220726-1-ga753b24)

Inspect or clean up the working tree at /var/folders/4q/r83_r5397js7n6p3213vsy600000gq/T/ruby-build.20221121154058.35374.xJa7ta
Results logged to /var/folders/4q/r83_r5397js7n6p3213vsy600000gq/T/ruby-build.20221121154058.35374.log

Last 10 log lines:
transform_mjit_header: SKIPPED to transform __inline_isfinitel
transform_mjit_header: SKIPPED to transform __inline_isfinited
transform_mjit_header: SKIPPED to transform __inline_isfinitef
transform_mjit_header: SKIPPED to transform __darwin_fd_clr
transform_mjit_header: SKIPPED to transform __darwin_fd_set
transform_mjit_header: SKIPPED to transform __darwin_fd_isset
transform_mjit_header: SKIPPED to transform __darwin_check_fd_set
transform_mjit_header: SKIPPED to transform __sputc
transdb.h updated
ln -sf ../../../.ext/include/arm64-darwin21/rb_mjit_min_header-2.6.10.h include/ruby-2.6.0/arm64-darwin21/rb_mjit_min_header-2.6.10.h

Solution

  • Run with prefix RUBY_CFLAGS="-w"
☁  RUBY_CFLAGS="-w" rbenv install 2.6.10
To follow progress, use 'tail -f /var/folders/4q/r83_r5397js7n6p3213vsy600000gq/T/ruby-build.20221121155329.4127.log' or pass --verbose
Downloading openssl-1.1.1q.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca
Installing openssl-1.1.1q...
patching file test/v3ext.c
Installed openssl-1.1.1q to /Users/risa.watanabe/.anyenv/envs/rbenv/versions/2.6.10

Downloading ruby-2.6.10.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.10.tar.bz2
Installing ruby-2.6.10...
ruby-build: using readline from homebrew
Installed ruby-2.6.10 to /Users/risa.watanabe/.anyenv/envs/rbenv/versions/2.6.10

☁  rbenv local  
2.6.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment