I've been trying to install ruby-related packages on my Mac.
However, I encounter the same error message with any installation, such as:
> sudo gem install cocoapods
<internal:core> core/kernel.rb:234:in `gem_original_require': Library "/usr/lib/libSystem.B.dylib" does not exist. (RuntimeError)
from /Users/ricky/.rbenv/versions/truffleruby-20.3.0/lib/mri/rubygems/core_ext/kernel_require.rb:54:in `require'
I thought it was a problem with the installed version of Ruby, so I try to update:
> rbenv install 3.0.2
Downloading ruby-3.0.2.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.2.tar.gz
Installing ruby-3.0.2...
ruby-build: using readline from homebrew
BUILD FAILED (macOS 12.5.1 using ruby-build 20210801)
Inspect or clean up the working tree at /var/folders/t0/m8gzjl_n0cl7gmf8pg27fw380000gn/T/ruby-build.20220909120553.62392.0EkgwI
Results logged to /var/folders/t0/m8gzjl_n0cl7gmf8pg27fw380000gn/T/ruby-build.20220909120553.62392.log
Last 10 log lines:
compiling enc/trans/newline.c
<internal:core> core/kernel.rb:260:in `require': Library "/usr/lib/libSystem.B.dylib" does not exist. (RuntimeError)
from /Users/ricky/.rbenv/versions/truffleruby-20.3.0/lib/mri/fileutils.rb:1083:in `<module:FileUtils>'
from /Users/ricky/.rbenv/versions/truffleruby-20.3.0/lib/mri/fileutils.rb:96:in `<top (required)>'
from <internal:core> core/kernel.rb:260:in `require'
from /private/var/folders/t0/m8gzjl_n0cl7gmf8pg27fw380000gn/T/ruby-build.20220909120553.62392.0EkgwI/ruby-3.0.2/tool/lib/vcs.rb:2:in `<top (required)>'
from <internal:core> core/kernel.rb:260:in `require'
from ./tool/file2lastrev.rb:10:in `<main>'
make: *** [revision.tmp] Error 1
make: *** Waiting for unfinished jobs....
Both of these errors indicate that Library "/usr/lib/libSystem.B.dylib" does not exist.
In such circumstances, what can I do to resolve this?
System Info:
OS: macOS 12.5.1
Chip: Apple M1 Pro