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

newbie question about download and installation #72

Open
gogitsome opened this issue Nov 8, 2018 · 14 comments
Open

newbie question about download and installation #72

gogitsome opened this issue Nov 8, 2018 · 14 comments

Comments

@gogitsome
Copy link

I wanted to download your program and use it on my 2011 macbook pro (running High Sierra 10.13.6), but it's not exactly clear to me what I'm supposed to do or in what order in order to get it working. I am VERY new to tinkering around with my mac, new to programming, and new to github, etc so please forgive the ignorance! ANY help or guidance you'd be willing to offer a newbie would be greatly appreciated!

If it helps with context, what I did try downloading the files and running the installation command in a terminal window, but I received the following message:

macbook-pro:Applications a$ sudo gem install iStats
Password:
Fetching: sparkr-0.4.1.gem (100%)
Successfully installed sparkr-0.4.1
Fetching: parseconfig-1.0.8.gem (100%)
Successfully installed parseconfig-1.0.8
Fetching: iStats-1.6.1.gem (100%)
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.3.0/gems/iStats-1.6.1/ext/osx_stats

/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20181107-637-1i81ihm.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

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

If you're not sure how to help get me going or don't have the time, at a minimum I would definitely appreciate it if you could let me know which leftover files/folders from the failed installation are specific to iStats so I can clean them out in the event I can't get the program up and running. Thank you!

@Chris911
Copy link
Owner

Chris911 commented Nov 9, 2018

Try installing ruby via brew first: brew install ruby and then install the gem.

@leon1995
Copy link

I get a similar issue

$ sudo gem install iStats
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.3.0/gems/iStats-1.6.1/ext/osx_stats
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20181226-93592-1hjbr6i.rb extconf.rb
creating Makefile

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

current directory: /Library/Ruby/Gems/2.3.0/gems/iStats-1.6.1/ext/osx_stats
make "DESTDIR="
make: *** No rule to make target `/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin18/ruby/config.h', needed by `smc.o'.  Stop.

make failed, exit code 2

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

(Without sudo I get a permission error)

ruby -v
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]

@nilliu
Copy link

nilliu commented Dec 27, 2018

@leon1995 I have exactly same errors you got,
I actually not sure which one make it works,
but I thought you can try step by step, here's what I did.
1.) install Homebrew, and then install ruby from Homebrew as suggestion above.
also you may want to setup the path as package says.

# add following to ~/.bash_profile
export PATH="/usr/local/opt/ruby/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/ruby/lib"
export CPPFLAGS="-I/usr/local/opt/ruby/include"

then re-open(or open a new terminal session, so that will apply above environment variables).
2.) install full Xcode from App Store(free),
and also launch once for accept agreement of Xcode,
then sudo gem clean and sudo gem install iStats again should works, good luck.

@nilliu
Copy link

nilliu commented Dec 27, 2018

btw, if somehow missing the command /usr/local/bin/istats
still can simply sudo vim /usr/local/bin/istats.
(if you familiar vi, or you can use any code editor to create the file)

then copy & paste the code from this GitHub repository for the missing executable file.

FYI.

@leon1995
Copy link

Thanks for the reply!

I already installed homebrew, xcode and ruby (via brew). I just added

export PATH="/usr/local/opt/ruby/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/ruby/lib"
export CPPFLAGS="-I/usr/local/opt/ruby/include"

to ~/.bash_profile as u mentioned and

$ sudo gem clean
$ sudo gem install iStats

did the work. But now it cant find the command istats when I try to use it.

$ istats --help
-bash: istats: command not found

@nilliu
Copy link

nilliu commented Dec 29, 2018

hi @leon1995 ,
just copy paste the ruby code from here
https://github.com/Chris911/iStats/tree/master/bin
to that command, and chmod a+x /usr/local/bin/istats, make it executable, that's all. :-)

@leon1995
Copy link

Works! thanks!

@fawnberry
Copy link

fawnberry commented Dec 31, 2018

hi @leon1995 ,
just copy paste the ruby code from here
https://github.com/Chris911/iStats/tree/master/bin
to that command, and chmod a+x /usr/local/bin/istats, make it executable, that's all. :-)

I am not sure how to paste that ruby code; though I have tried it in Xcode by modifying the command line. But as it turns out, another error occurred as well:
Error: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- osx_stats (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /Library/Ruby/Gems/2.3.0/gems/iStats-1.6.1/lib/iStats.rb:2:in <top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /Library/Ruby/Gems/2.3.0/gems/iStats-1.6.1/bin/istats:6:in

'
— client.js:1:749223
http://127.0.0.1:41416/run/Failed to load resource: the server responded with a status of 500 (Internal Server Error)
redraw — client.js:1:734729index-js: – Error: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- osx_stats (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /Library/Ruby/Gems/2.3.0/gems/iStats-1.6.1/lib/iStats.rb:2:in <top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /Library/Ruby/Gems/2.3.0/gems/iStats-1.6.1/bin/istats:6:in '
— client.js:1:749223
Still experiencing error:
iStats --help
-bash: /usr/local/bin/iStats: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory

iStats seems to be installed and running when I typed in:
/Library/Ruby/Gems/2.3.0/gems/iStats-1.6.1/bin/istats

I just cannot seem to be able to have it working on my desktop anymore.

Any help/assistance is much appreciated! Thank you.

@nilliu
Copy link

nilliu commented Jan 1, 2019

@fawnberry obviously you missing bash env.

if you are working on make your Übersicht works,
please get in the Übersicht Preferences,
there's a checkbox "Shell Commands: ✅Load Bash env"
make sure it checked.

then you won't missing those env. ;-)

@fawnberry
Copy link

I had that checkbox checked, still didn't work. Decided to not use this widget anymore. It worked beautifully up until I did an update.

@leon1995
Copy link

leon1995 commented Jan 1, 2019

@fawnberry does istats work in a terminal? Im not sure what do you mean by trying in xcode and modifying the command line

@DDior
Copy link

DDior commented Jan 7, 2019

I have same issue too, and it was solved just when I update ruby to 2.6.

@pgeorgan
Copy link

pgeorgan commented Feb 17, 2019

I ran into a similar situation. For whatever reason, "sudo gem install" worked to modify Mac's installation of Ruby. Some time after upgrading to Mojave, I ran 'istats' after a period of time in which I hadn't used it, and it complained about which version I was running. It suggested executing 'gem pristine iStats --version 1.5.2'. I did and that broke my installation. At this point, I was getting a permissions error trying to uninstall and reinstall iStats (rightly so, as it's not a good practice to modify Apple's ruby install). Eventually, I just reinstalled ruby using Homebrew and did as suggested (putting ruby at the start of $PATH). This allowed me to reinstall iStats at which point I was able to confirm that particular executable worked. I ran into a new issue where 'which istats' was still pointing to the broken version. To remedy this, I simply added an alias in my bash_profile. 'alias istats='/usr/local/lib/ruby/gems/2.6.0/bin/istats'

@SenileFelineS
Copy link

SenileFelineS commented May 8, 2019

I'm also having trouble installing iStats on my Mac OS X 10.7 (Lion) 2012 Macbook Pro. Is it supported? The following is my output from running $ sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install iStats

from file: gem_make.out
current directory: /opt/local/lib/ruby2.6/gems/2.6.0/gems/iStats-1.6.1/ext/osx_stats
/opt/local/bin/ruby2.6 -I /opt/local/lib/ruby2.6/2.6.0 -r ./siteconf20190508-98224-1bqpnav.rb extconf.rb
creating Makefile

current directory: /opt/local/lib/ruby2.6/gems/2.6.0/gems/iStats-1.6.1/ext/osx_stats
make "DESTDIR=" clean

current directory: /opt/local/lib/ruby2.6/gems/2.6.0/gems/iStats-1.6.1/ext/osx_stats
make "DESTDIR="
compiling smc.c
In file included from smc.c:22:
In file included from /opt/local/include/ruby-2.6.0/ruby.h:33:
/opt/local/include/ruby-2.6.0/ruby/ruby.h:1688:12: error: expected ';' at end of declaration
    DSIZE_T c2 = (DSIZE_T)a * (DSIZE_T)b;
           ^
           ;
/opt/local/include/ruby-2.6.0/ruby/ruby.h:1689:9: error: use of undeclared identifier 'c2'
    if (c2 > max) return 1;
        ^
/opt/local/include/ruby-2.6.0/ruby/ruby.h:1690:18: error: use of undeclared identifier 'c2'
    *c = (size_t)c2;
                 ^
/opt/local/include/ruby-2.6.0/ruby/ruby.h:1904:1: warning: unknown attribute 'cold' ignored [-Wattributes]
COLDFUNC PRINTF_ARGS(NORETURN(void rb_bug(const char*, ...)), 1, 2);
^
/opt/local/include/ruby-2.6.0/ruby/defines.h:97:33: note: expanded from macro 'COLDFUNC'
#define COLDFUNC __attribute__((cold))
                                ^
In file included from smc.c:22:
In file included from /opt/local/include/ruby-2.6.0/ruby.h:33:
/opt/local/include/ruby-2.6.0/ruby/ruby.h:1904:1: warning: unknown attribute 'cold' ignored [-Wattributes]
COLDFUNC PRINTF_ARGS(NORETURN(void rb_bug(const char*, ...)), 1, 2);
^
/opt/local/include/ruby-2.6.0/ruby/defines.h:97:33: note: expanded from macro 'COLDFUNC'
#define COLDFUNC __attribute__((cold))
                                ^
In file included from smc.c:22:
In file included from /opt/local/include/ruby-2.6.0/ruby.h:33:
/opt/local/include/ruby-2.6.0/ruby/ruby.h:1928:1: warning: unknown attribute 'cold' ignored [-Wattributes]
COLDFUNC PRINTF_ARGS(void rb_warn(const char*, ...), 1, 2);
^
/opt/local/include/ruby-2.6.0/ruby/defines.h:97:33: note: expanded from macro 'COLDFUNC'
#define COLDFUNC __attribute__((cold))
                                ^
In file included from smc.c:22:
In file included from /opt/local/include/ruby-2.6.0/ruby.h:33:
In file included from /opt/local/include/ruby-2.6.0/ruby/ruby.h:2111:
/opt/local/include/ruby-2.6.0/ruby/intern.h:506:1: warning: unknown attribute 'cold' ignored [-Wattributes]
COLDFUNC NORETURN(void rb_memerror(void));
^
/opt/local/include/ruby-2.6.0/ruby/defines.h:97:33: note: expanded from macro 'COLDFUNC'
#define COLDFUNC __attribute__((cold))
                                ^
In file included from smc.c:22:
In file included from /opt/local/include/ruby-2.6.0/ruby.h:33:
In file included from /opt/local/include/ruby-2.6.0/ruby/ruby.h:2111:
/opt/local/include/ruby-2.6.0/ruby/intern.h:506:1: warning: unknown attribute 'cold' ignored [-Wattributes]
COLDFUNC NORETURN(void rb_memerror(void));
^
/opt/local/include/ruby-2.6.0/ruby/defines.h:97:33: note: expanded from macro 'COLDFUNC'
#define COLDFUNC __attribute__((cold))
                                ^
5 warnings and 3 errors generated.
make: *** [smc.o] Error 1

make failed, exit code 2

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

8 participants