ruby-build: Can't install ruby on macOS High Sierra
I migrated my OSX from one MacBook to another and now I can’t install ruby. I tried to install different versions but no results. I tried to remove Command Tools and install it again.
I receive this error every time:
~ $ rbenv install 2.4.0
ruby-build: use openssl from homebrew
Downloading ruby-2.4.0.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.0.tar.bz2
Installing ruby-2.4.0...1
ruby-build: use readline from homebrew
BUILD FAILED (OS X 10.13.2 using ruby-build 20171226)
Inspect or clean up the working tree at /var/folders/kk/5klq1cps5f3g1j5sxhrj4k080000gp/T/ruby-build.20180104142005.18508
Results logged to /var/folders/kk/5klq1cps5f3g1j5sxhrj4k080000gp/T/ruby-build.20180104142005.18508.log
Last 10 log lines:
/usr/local/include/Block.h:263:2: error: unknown type name 'lzma_bool'
lzma_bool reserved_bool2;
^
/usr/local/include/Block.h:264:2: error: unknown type name 'lzma_bool'
lzma_bool reserved_bool3;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [file.o] Error 1
make: *** Waiting for unfinished jobs....
Detailed logs here: https://gist.github.com/blddmnd/0022c03bd2a551535ee06151a7102075
It will be great if someone can help me.
Thank you.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 21
- Comments: 17
Solution is:
"I found a workaround by renaming /usr/local/include to /usr/local/include_old (well, name does not really matter, just the fact that g++/clang will not search for headers in this folder anymore). "
*g++/clang is looking for headers for some reason in this path, This happens when you migrate from one Mac to another and/or upgrade to HighSierra.
It did the trick and Finally, I was able to install Ruby!!!
Description: https://stackoverflow.com/questions/46872922/broken-c-std-libraries-on-macos-high-sierra-10-13
I had same problem. I deleted
/usr/local/include/block.h
from the result ofbrew doctor
. Its works for me.thanks @myxaluch
I have the same issue. I rename /usr/local/include to /usr/local/include to /usr/local/include to /usr/local/include_old and solve the issue. Thanks @stanislavpa
@blddmnd @kamusin I investigated with colleagues and we’ve found the solution. First, problem - it’s migration tool from old mac to new not correctly supports
brew
and libraries installed by brew. After migration, I’ve ranbrew doctor
and saw full log with .h files problems and broken symlink. After that, I began resolve each problem with library and dependencies, and when I clean mybrew doctor
output, I can install ruby successfully. So, maybe we could try it tooI can confirm that removing everything
brew doctor
complains about fixed the issue for me. 👯♂️ 👯This worked for me as well. The migration tool is a disaster.
This thread saved my sanity. Thanks all for sharing trials and solutions.
Thanks all for the help here.
/usr/local/include_old
worked for me as well.@matthewsalan yes
I get the same error as well. Used the migration tool from my old MBP to new MBP (MacBookPro14,2, OS - 10.13.3 (17D47)). I got the same error in the original post, then removed
/usr/local/include/block.h
and get the error below: (full log: https://gist.github.com/matthewsalan/07efbd850cb3cdf8bd0839ddbd4f7bed)@blddmnd Did reformatting the SSD and reinsalling OSX work for you?