Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install fails on 10.4.11 #96

Open
ltpitt opened this issue Jul 14, 2020 · 4 comments
Open

Install fails on 10.4.11 #96

ltpitt opened this issue Jul 14, 2020 · 4 comments

Comments

@ltpitt
Copy link

ltpitt commented Jul 14, 2020

Hello there,

I write from the past :)

I tried installing this nice software on my eMac using 10.4.11.
I installed ruby via homebrew:
ruby 2.4.1p111 (2017-03-22 revision 58053) [powerpc-darwin8.0]

And tried the command in README.md to install:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future

And then gem install iStats or sudo gem install iStats but I got error anyway:
Building native extensions. This could take a while...

ERROR:  Error installing iStats:
        ERROR: Failed to build gem native extension.

    current directory: /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/gems/2.4.0/gems/iStats-1.6.1/ext/osx_stats
/usr/local/Cellar/ruby/2.4.1_1/bin/ruby -r ./siteconf20200715-27343-fjhuzx.rb extconf.rb
creating Makefile

current directory: /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/gems/2.4.0/gems/iStats-1.6.1/ext/osx_stats
make "DESTDIR=" clean

current directory: /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/gems/2.4.0/gems/iStats-1.6.1/ext/osx_stats
make "DESTDIR="
compiling smc.c
smc.c: In function 'method_get_battery_time_remaining':
smc.c:417: error: 'kIOPSTimeRemainingUnknown' undeclared (first use in this function)
smc.c:417: error: (Each undeclared identifier is reported only once
smc.c:417: error: for each function it appears in.)
smc.c:419: error: 'kIOPSTimeRemainingUnlimited' undeclared (first use in this function)
make: *** [smc.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/gems/2.4.0/gems/iStats-1.6.1 for inspection.
Results logged to /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/gems/2.4.0/extensions/powerpc-darwin-8/2.4.0/iStats-1.6.1/gem_make.out

Is there any hope for my dinosaur or I'll have to write my own little stats script?

Thanks for your time and help.

@Chris911
Copy link
Owner

Have you tried (re)installing the xcode command line tools with xcode-select --install?

@ltpitt
Copy link
Author

ltpitt commented Jul 15, 2020

If I try that command I get:
-bash: xcode-select: command not found

I tried removing my xcode and reinstalling from scratch but the error remains identical.

The command provided in your README.md:
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install iStats

returns:
sudo: ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future: command not found

So I tried to do two commands:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future

and then:
gem install iStats (with or without sudo)

But I always get:

Building native extensions.  This could take a while...
ERROR:  Error installing iStats:
        ERROR: Failed to build gem native extension.

    current directory: /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/gems/2.4.0/gems/iStats-1.6.1/ext/osx_stats
/usr/local/Cellar/ruby/2.4.1_1/bin/ruby -r ./siteconf20200715-795-13qzuvs.rb extconf.rb
creating Makefile

current directory: /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/gems/2.4.0/gems/iStats-1.6.1/ext/osx_stats
make "DESTDIR=" clean

current directory: /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/gems/2.4.0/gems/iStats-1.6.1/ext/osx_stats
make "DESTDIR="
compiling smc.c
smc.c: In function 'method_get_battery_time_remaining':
smc.c:417: error: 'kIOPSTimeRemainingUnknown' undeclared (first use in this function)
smc.c:417: error: (Each undeclared identifier is reported only once
smc.c:417: error: for each function it appears in.)
smc.c:419: error: 'kIOPSTimeRemainingUnlimited' undeclared (first use in this function)
make: *** [smc.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/gems/2.4.0/gems/iStats-1.6.1 for inspection.
Results logged to /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/gems/2.4.0/extensions/powerpc-darwin-8/2.4.0/iStats-1.6.1/gem_make.out

Thanks for your kind help!

@jordanlambrecht
Copy link

Also having this issue

@sockshrimp
Copy link

sockshrimp commented Mar 27, 2022

I had this issues and fix with following.

Installed zsh
brew install zsh

sudo gem install iStats gave me this

➜  .oh-my-zsh git:(master) sudo gem install iStats
Password:
Building native extensions. This could take a while...
ERROR:  Error installing iStats:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/iStats-1.6.1/ext/osx_stats
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20220327-12983-quza7t.rb extconf.rb
creating Makefile

current directory: /Library/Ruby/Gems/2.6.0/gems/iStats-1.6.1/ext/osx_stats
make "DESTDIR=" clean

current directory: /Library/Ruby/Gems/2.6.0/gems/iStats-1.6.1/ext/osx_stats
make "DESTDIR="
make: *** No rule to make target `/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin19/ruby/config.h', needed by `smc.o'.  Stop.

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/iStats-1.6.1 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/iStats-1.6.1/gem_make.out

I did the following which got iStats installed:
brew uninstall ruby

then : brew install ruby

then : export PATH="/usr/local/opt/ruby/bin:$PATH"

then : export PATH="/usr/local/opt/ruby/gems/3.1.1/bin:$PATH"
note - your version may depend. Please cd to /usr/local/opt/ruby/gems/XXXto find version that you have.

then : source~/.zshrc

then : sudo gem install iStats

Notes:

Ruby Version
ruby -v ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-darwin19]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants