iStats: Fails to install in 10.14
BuildVersion: 18A391, ProductVersion: 10.14
Building native extensions. This could take a while...
ERROR: Error installing iStats:
ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.5.0/gems/iStats-1.6.1/ext/osx_stats
/usr/local/opt/ruby/bin/ruby -r ./siteconf20181015-34693-1vpa299.rb extconf.rb
creating Makefile
current directory: /usr/local/lib/ruby/gems/2.5.0/gems/iStats-1.6.1/ext/osx_stats
make "DESTDIR=" clean
current directory: /usr/local/lib/ruby/gems/2.5.0/gems/iStats-1.6.1/ext/osx_stats
make "DESTDIR="
compiling smc.c
In file included from smc.c:23:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
/usr/local/include/Block.h:16:3: error: Never include this file directly. Use <lzma.h> instead.
# error Never include this file directly. Use <lzma.h> instead.
^
/usr/local/include/Block.h:93:2: error: unknown type name 'lzma_check'
lzma_check check;
^
/usr/local/include/Block.h:148:2: error: unknown type name 'lzma_vli'
lzma_vli compressed_size;
^
/usr/local/include/Block.h:172:2: error: unknown type name 'lzma_vli'
lzma_vli uncompressed_size;
^
/usr/local/include/Block.h:200:2: error: unknown type name 'lzma_filter'
lzma_filter *filters;
^
/usr/local/include/Block.h:217:20: error: use of undeclared identifier 'LZMA_CHECK_SIZE_MAX'
uint8_t raw_check[LZMA_CHECK_SIZE_MAX];
^
/usr/local/include/Block.h:231:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int3;
^
/usr/local/include/Block.h:232:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int4;
^
/usr/local/include/Block.h:233:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int5;
^
/usr/local/include/Block.h:234:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int6;
^
/usr/local/include/Block.h:235:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int7;
^
/usr/local/include/Block.h:236:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int8;
^
/usr/local/include/Block.h:237:2: error: unknown type name 'lzma_reserved_enum'
lzma_reserved_enum reserved_enum1;
^
/usr/local/include/Block.h:238:2: error: unknown type name 'lzma_reserved_enum'
lzma_reserved_enum reserved_enum2;
^
/usr/local/include/Block.h:239:2: error: unknown type name 'lzma_reserved_enum'
lzma_reserved_enum reserved_enum3;
^
/usr/local/include/Block.h:240:2: error: unknown type name 'lzma_reserved_enum'
lzma_reserved_enum reserved_enum4;
^
/usr/local/include/Block.h:261:2: error: unknown type name 'lzma_bool'
lzma_bool ignore_check;
^
/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: *** [smc.o] Error 1
make failed, exit code 2
Gem files will remain installed in /usr/local/lib/ruby/gems/2.5.0/gems/iStats-1.6.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-18/2.5.0/iStats-1.6.1/gem_make.out
lzma was install through the xz formula via brew. This error is produced with and without ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (6 by maintainers)
solution for me: 1:
sudo xcode-select --switch /Library/Developer/CommandLineTools2:sudo gem install iStatsreference: https://stackoverflow.com/a/58226876/2506135
I had the same issue before, my solution is:
Make sure you have installed xcode-select
Install following package.
After installed macOS_SDK_headers_for_macOS_10.14.pkg, it generated the folder universal-darwin18
Then you can install iStats.
Just adding my 2 cents here: It worked for me
I’m on a new MBP 15" 2018, so everything is freshly installed from scratch. I’ve installed things, more or less in this order:
brewfor the first time in my life, but I think it’s not involved here because of next point:rvm install 2.5.1(it compiled from sources, so I guess it used the Xcode installation from the first point)gem install iStatsistats scanit took a while but found lots of “unknown” sensors that were not present in my old machineistats enable allJust FYI, I’m copying the output of the
all --no-graphscommandNow our friend @Chris911 can tell us what all those new unknow keys refer to. I notice that many of them return
0.0°Cso they may not apply to my machine. Many others return what look like sensible values, but I have no idea what they are measuring.I had the same problem as @Bunn, and I found another solution from https://github.com/vmg/redcarpet/issues/668#issuecomment-444283767.
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18](ruby --version)2.5.2.3(gem --version)xcode-select version 2354.(xcode-select --version)/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin18/DOES NOT EXIST.From similar issues elsewhere, the problem seems to be that
makecan not find the file/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin18/ruby/config.h. This is because the file is located at/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin17/ruby/config.h.From the information at these other links, it seems like this is a mistake in MacOS, and this file is supposed to be located in
darwin18.This due to a change from 10.13.3, which was Darwin 17 (
unname -a) and 10.14.3 which is Darwin 18. This file directory is supposed to reflect the change, but it does not.Fix
I was able to fix this by disabling system integrity and copying the folder
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin17/asuniversal-darwin18.This command would also work:
This worked for me, though I could not find a simpler way to do this. If the Makefile is edited to reference
darwin17, I believe this script will work. However, I am not how to make that install script.Also, may I suggest that this be reopened, as there would be a fix, even though the error is not in iStat, but MacOS?
This worked perfectly. You don’t need sudo for the
gem install iStatsline.Also fix this issue by using
brew insatll rubyto upgrade ruby to 2.5.3Also needs to check your terminal is using the correct version of ruby.
Thanks you @pscott-au