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

Same problem with iStats #100

Open
shivahoj opened this issue Nov 16, 2020 · 4 comments
Open

Same problem with iStats #100

shivahoj opened this issue Nov 16, 2020 · 4 comments

Comments

@shivahoj
Copy link

shivahoj commented Nov 16, 2020

Hello, OSX catalina 10.15.7 on an unsupported Macbook 2011 (via dosdude's catalinaPatcher) here.
I know nothing about ruby, so bear with me.

> $ which ruby
/usr/bin/ruby
~                                                                                                                                                              [17:45:51]
> $ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]

> $ 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 ./siteconf20201116-4433-ufypgo.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

What should I do?

@Nakilon
Copy link

Nakilon commented Nov 17, 2020

Don't use sudo on macOS.
Either use these env variables to instruct the gem command to install somewhere in your user directory: https://stackoverflow.com/a/27677094/322020
Or better install Homebrew and do brew install rbenv and read docs abut using rbenv that will then install gems somehere in ~/.rbenv.

@Sugar-Coder
Copy link

Same problem on Big Sur.
I use the gem install iStats and get the same output like above.
But I have added the
export PATH="$HOME/.gem/ruby/2.6.0/bin:$PATH" export GEM_HOME=$HOME/.gem
to my .bash_profile.

@ghost
Copy link

ghost commented Dec 31, 2020

Hello, OSX catalina 10.15.7 on an unsupported Macbook 2011 (via dosdude's catalinaPatcher) here.
I know nothing about ruby, so bear with me.

> $ which ruby
/usr/bin/ruby
~                                                                                                                                                              [17:45:51]
> $ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]

> $ 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 ./siteconf20201116-4433-ufypgo.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

What should I do?

Same problem on Big Sur.
I use the gem install iStats and get the same output like above.
But I have added the
export PATH="$HOME/.gem/ruby/2.6.0/bin:$PATH" export GEM_HOME=$HOME/.gem
to my .bash_profile.

You can do these to make it work:

First, don't use the gem that Mac provides you, if you use this one, You need 'sudo', and get error.

brew install ruby

Run it to install a gem.

Then add this ruby path and this gem path to your .zshrc files, in my Mac is like this

export PATH="/usr/local/opt/ruby/bin:$PATH"
export PATH="/usr/local/lib/ruby/gems/3.0.0/bin:$PATH"

It may be different in your Mac ! And The istats will install in /usr/local/lib/ruby/gems/(your gem version)/gems/

Finally, run

source ~/.zshrc
gem install iStats
istats

You can find it works well.
image
image

@ChiehJang
Copy link

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