You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BUILD FAILED (macOS 11.6 using ruby-build 20210928)
Inspect or clean up the working tree at /var/folders/qn/6glckh8s1jn5x74lj7bkm7gr0000gn/T/ruby-build.20211006144832.95659.r8FA33
Results logged to /var/folders/qn/6glckh8s1jn5x74lj7bkm7gr0000gn/T/ruby-build.20211006144832.95659.log
BUILD FAILED (macOS 11.6 using ruby-build 20210928)
Inspect or clean up the working tree at /var/folders/h8/y2qk65cs3zd35cq2frzj_wqc0000gn/T/ruby-build.20211012143529.16821.OcOFOF
Results logged to /var/folders/h8/y2qk65cs3zd35cq2frzj_wqc0000gn/T/ruby-build.20211012143529.16821.log
Last 10 log lines:
${LDCMD:-clang} -arch arm64 -O3 -Wall -L. -Wl,-search_paths_first -L/usr/local/var/rbenv/versions/3.0.0/lib
-o fuzz/client-test fuzz/client.o fuzz/test-corpus.o
-lssl -lcrypto
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/3.0.0/lib'
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/3.0.0/lib'
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/3.0.0/lib'
make depend && make _build_libs
make[1]: Nothing to be done for `_build_libs'.
Cannot create directory /usr/local/var: Permission denied
make: *** [install_runtime_libs] Error 2
I had multiple versions of ruby installed. After I uninstalled everything and reinstalled only 2.6.5, it worked for me. I think failing during install of openssl-1.1.1l may be a different issue anyway.
There are several misconceptions going on here. First, the "-Wno-error=implicit-function-declaration" flag should never be set. It's a dangerous hack that overrides macOS defaults, as explained here: #2001 (comment)
I've been using Ruby for 13 years and not a single time have I ever had to set that flag. If you have a proper Ruby dev setup, and you're installing the appropriate version of Ruby in the appropriate context, you should never need to set that flag.
The second misconception is that if your project is using a specific version of Ruby, then your only option is to install that specific version. I see so many people try to install older versions of Ruby 2.6.x, like in this GitHub issue, when the solution is to update your project to the latest patch version (the 3rd digit), which is 2.6.10.
rbenv/ruby-build can install 2.6.x versions as old as 2.6.8 on Apple Silicon Macs in native mode without any issues and without having to set any flags.
Activity
me25hage commentedon Oct 12, 2021
I have this same Build Failed error with 3.0.0 except, my build fails during the install of openssl-1.1.1l. Log attached.
ruby-build.20211012143529.16821.log
Downloading openssl-1.1.1l.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
Installing openssl-1.1.1l...
BUILD FAILED (macOS 11.6 using ruby-build 20210928)
Inspect or clean up the working tree at /var/folders/h8/y2qk65cs3zd35cq2frzj_wqc0000gn/T/ruby-build.20211012143529.16821.OcOFOF
Results logged to /var/folders/h8/y2qk65cs3zd35cq2frzj_wqc0000gn/T/ruby-build.20211012143529.16821.log
Last 10 log lines:
${LDCMD:-clang} -arch arm64 -O3 -Wall -L. -Wl,-search_paths_first -L/usr/local/var/rbenv/versions/3.0.0/lib
-o fuzz/client-test fuzz/client.o fuzz/test-corpus.o
-lssl -lcrypto
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/3.0.0/lib'
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/3.0.0/lib'
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/3.0.0/lib'
make depend && make _build_libs
make[1]: Nothing to be done for `_build_libs'.
Cannot create directory /usr/local/var: Permission denied
make: *** [install_runtime_libs] Error 2
amitmahajan12 commentedon Oct 12, 2021
I had multiple versions of ruby installed. After I uninstalled everything and reinstalled only 2.6.5, it worked for me. I think failing during install of openssl-1.1.1l may be a different issue anyway.
gplusdotgr commentedon Nov 29, 2021
nothing works ..
rivitt commentedon Dec 3, 2021
I'm getting this same error on macOS 11.6 and 12.0.1 (m1 chip), I'm going to uninstall and reinstall everything and see where that takes me
iamricks commentedon Dec 8, 2021
I'm getting the same issue trying to install 2.6.3 but i am able to install and use 3.0.2 and 3.0.3 just fine, maybe the issue is just with 2.6.x?
x-warukira commentedon Jun 27, 2022
export optflags="-Wno-error=implicit-function-declaration"worked for meJShefferCorp commentedon Aug 15, 2022
Thanks, this also worked for me.
MacOS: 12.5
Processor: Apple M1 Pro
markst commentedon Jun 8, 2023
Legend @x-warukira! That's finally fixed being unable to install
2.6.0on my M1mrmeszaros commentedon Jul 27, 2023
This Worked on my machine
MacOS:
Ventura (13.4.1)Processor:
Apple M1 ProOn that note - would it be possible to persistently set that variable for the context of
ruby-buildorrbenv-install?@x-warukira How did You find the solution? I am interested to see what component reads the
optflagsvariable!monfresh commentedon Jul 27, 2023
There are several misconceptions going on here. First, the "-Wno-error=implicit-function-declaration" flag should never be set. It's a dangerous hack that overrides macOS defaults, as explained here: #2001 (comment)
I've been using Ruby for 13 years and not a single time have I ever had to set that flag. If you have a proper Ruby dev setup, and you're installing the appropriate version of Ruby in the appropriate context, you should never need to set that flag.
The second misconception is that if your project is using a specific version of Ruby, then your only option is to install that specific version. I see so many people try to install older versions of Ruby 2.6.x, like in this GitHub issue, when the solution is to update your project to the latest patch version (the 3rd digit), which is 2.6.10.
rbenv/ruby-build can install 2.6.x versions as old as 2.6.8 on Apple Silicon Macs in native mode without any issues and without having to set any flags.
Here's a detailed article I wrote that explains how and why to upgrade the Ruby version in your project.
If for some highly unlikely reason you absolutely need to use a version of 2.6.x older than 2.6.8, then the best option is to use Rosetta.