Having trouble installing ruby gem for iStats












2















I am trying to install iStats via a ruby gem.



First I ran the command:



xcode-select --install and the output was:



xcode-select: error: command line tools are already installed, use "Software Update" to install updates. So that was okay.



Then I ran:



sudo gem install iStats



and the output was:



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 ./siteconf20190117-44665-taivle.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 `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin16/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-16/2.3.0/iStats-1.6.1/gem_make.out


I'm not sure what all of this means, but I know it did not work.
So I tried installing ruby using:



brew install ruby, which seemed to do its job.



Then I tried the sudo gem command again but I got the same output as above.



What is going wrong here?



EDIT:



I just read https://stackoverflow.com/a/26600110/6678549 and tried this:



sudo gem update --system and got this output:



Updating rubygems-update
Successfully installed rubygems-update-3.0.2
Parsing documentation for rubygems-update-3.0.2
Installing darkfish documentation for rubygems-update-3.0.2
Done installing documentation for rubygems-update after 108 seconds
Parsing documentation for rubygems-update-3.0.2
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 3.0.2
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/gem


So it almost worked, but I'm still no closer to installing iStats.



EDIT 2:



My ruby version is ruby 2.3.7p456 in case it is relevant and I am using MacOS Sierra. I have done a bit of reading and found about System Integrity Protection. I have tried a few other commands like sudo gem install iStats -n /usr/local/bin, but still nothing works. Although after runningsudo gem update --system` it now says the latest version is already installed.










share|improve this question





























    2















    I am trying to install iStats via a ruby gem.



    First I ran the command:



    xcode-select --install and the output was:



    xcode-select: error: command line tools are already installed, use "Software Update" to install updates. So that was okay.



    Then I ran:



    sudo gem install iStats



    and the output was:



    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 ./siteconf20190117-44665-taivle.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 `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin16/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-16/2.3.0/iStats-1.6.1/gem_make.out


    I'm not sure what all of this means, but I know it did not work.
    So I tried installing ruby using:



    brew install ruby, which seemed to do its job.



    Then I tried the sudo gem command again but I got the same output as above.



    What is going wrong here?



    EDIT:



    I just read https://stackoverflow.com/a/26600110/6678549 and tried this:



    sudo gem update --system and got this output:



    Updating rubygems-update
    Successfully installed rubygems-update-3.0.2
    Parsing documentation for rubygems-update-3.0.2
    Installing darkfish documentation for rubygems-update-3.0.2
    Done installing documentation for rubygems-update after 108 seconds
    Parsing documentation for rubygems-update-3.0.2
    Done installing documentation for rubygems-update after 0 seconds
    Installing RubyGems 3.0.2
    ERROR: While executing gem ... (Errno::EPERM)
    Operation not permitted @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/gem


    So it almost worked, but I'm still no closer to installing iStats.



    EDIT 2:



    My ruby version is ruby 2.3.7p456 in case it is relevant and I am using MacOS Sierra. I have done a bit of reading and found about System Integrity Protection. I have tried a few other commands like sudo gem install iStats -n /usr/local/bin, but still nothing works. Although after runningsudo gem update --system` it now says the latest version is already installed.










    share|improve this question



























      2












      2








      2








      I am trying to install iStats via a ruby gem.



      First I ran the command:



      xcode-select --install and the output was:



      xcode-select: error: command line tools are already installed, use "Software Update" to install updates. So that was okay.



      Then I ran:



      sudo gem install iStats



      and the output was:



      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 ./siteconf20190117-44665-taivle.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 `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin16/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-16/2.3.0/iStats-1.6.1/gem_make.out


      I'm not sure what all of this means, but I know it did not work.
      So I tried installing ruby using:



      brew install ruby, which seemed to do its job.



      Then I tried the sudo gem command again but I got the same output as above.



      What is going wrong here?



      EDIT:



      I just read https://stackoverflow.com/a/26600110/6678549 and tried this:



      sudo gem update --system and got this output:



      Updating rubygems-update
      Successfully installed rubygems-update-3.0.2
      Parsing documentation for rubygems-update-3.0.2
      Installing darkfish documentation for rubygems-update-3.0.2
      Done installing documentation for rubygems-update after 108 seconds
      Parsing documentation for rubygems-update-3.0.2
      Done installing documentation for rubygems-update after 0 seconds
      Installing RubyGems 3.0.2
      ERROR: While executing gem ... (Errno::EPERM)
      Operation not permitted @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/gem


      So it almost worked, but I'm still no closer to installing iStats.



      EDIT 2:



      My ruby version is ruby 2.3.7p456 in case it is relevant and I am using MacOS Sierra. I have done a bit of reading and found about System Integrity Protection. I have tried a few other commands like sudo gem install iStats -n /usr/local/bin, but still nothing works. Although after runningsudo gem update --system` it now says the latest version is already installed.










      share|improve this question
















      I am trying to install iStats via a ruby gem.



      First I ran the command:



      xcode-select --install and the output was:



      xcode-select: error: command line tools are already installed, use "Software Update" to install updates. So that was okay.



      Then I ran:



      sudo gem install iStats



      and the output was:



      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 ./siteconf20190117-44665-taivle.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 `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin16/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-16/2.3.0/iStats-1.6.1/gem_make.out


      I'm not sure what all of this means, but I know it did not work.
      So I tried installing ruby using:



      brew install ruby, which seemed to do its job.



      Then I tried the sudo gem command again but I got the same output as above.



      What is going wrong here?



      EDIT:



      I just read https://stackoverflow.com/a/26600110/6678549 and tried this:



      sudo gem update --system and got this output:



      Updating rubygems-update
      Successfully installed rubygems-update-3.0.2
      Parsing documentation for rubygems-update-3.0.2
      Installing darkfish documentation for rubygems-update-3.0.2
      Done installing documentation for rubygems-update after 108 seconds
      Parsing documentation for rubygems-update-3.0.2
      Done installing documentation for rubygems-update after 0 seconds
      Installing RubyGems 3.0.2
      ERROR: While executing gem ... (Errno::EPERM)
      Operation not permitted @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/gem


      So it almost worked, but I'm still no closer to installing iStats.



      EDIT 2:



      My ruby version is ruby 2.3.7p456 in case it is relevant and I am using MacOS Sierra. I have done a bit of reading and found about System Integrity Protection. I have tried a few other commands like sudo gem install iStats -n /usr/local/bin, but still nothing works. Although after runningsudo gem update --system` it now says the latest version is already installed.







      ruby homebrew xcode rubygems






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 17 at 15:06







      kashveyron

















      asked Jan 17 at 14:18









      kashveyronkashveyron

      16114




      16114






















          1 Answer
          1






          active

          oldest

          votes


















          0














          I have done it!



          I am not sure exactly what I did right, but I used these two commands:



          export LDFLAGS="-L/usr/local/opt/ruby/lib"



          export CPPFLAGS="-I/usr/local/opt/ruby/include"



          Then I tried:



          sudo gem install iStats



          and



          sudo gem install iStats -n /usr/local/bin



          Now I have successfully installed iStats 1.6.1.



          Strangely though, I used those two export commands earlier on and they did not do the trick. So something must have changed in the meantime, I don't know what it is.






          share|improve this answer



















          • 1





            Note that I recommend against messing with the system Ruby and instead installing rbenv: github.com/rbenv/rbenv – this should make your life easier, and you don't need to run sudo for anything.

            – slhck
            Jan 17 at 15:52











          • @slhck Thanks for the advice, I'll keep that in mind in the future.

            – kashveyron
            Jan 17 at 18:56











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1395401%2fhaving-trouble-installing-ruby-gem-for-istats%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          I have done it!



          I am not sure exactly what I did right, but I used these two commands:



          export LDFLAGS="-L/usr/local/opt/ruby/lib"



          export CPPFLAGS="-I/usr/local/opt/ruby/include"



          Then I tried:



          sudo gem install iStats



          and



          sudo gem install iStats -n /usr/local/bin



          Now I have successfully installed iStats 1.6.1.



          Strangely though, I used those two export commands earlier on and they did not do the trick. So something must have changed in the meantime, I don't know what it is.






          share|improve this answer



















          • 1





            Note that I recommend against messing with the system Ruby and instead installing rbenv: github.com/rbenv/rbenv – this should make your life easier, and you don't need to run sudo for anything.

            – slhck
            Jan 17 at 15:52











          • @slhck Thanks for the advice, I'll keep that in mind in the future.

            – kashveyron
            Jan 17 at 18:56
















          0














          I have done it!



          I am not sure exactly what I did right, but I used these two commands:



          export LDFLAGS="-L/usr/local/opt/ruby/lib"



          export CPPFLAGS="-I/usr/local/opt/ruby/include"



          Then I tried:



          sudo gem install iStats



          and



          sudo gem install iStats -n /usr/local/bin



          Now I have successfully installed iStats 1.6.1.



          Strangely though, I used those two export commands earlier on and they did not do the trick. So something must have changed in the meantime, I don't know what it is.






          share|improve this answer



















          • 1





            Note that I recommend against messing with the system Ruby and instead installing rbenv: github.com/rbenv/rbenv – this should make your life easier, and you don't need to run sudo for anything.

            – slhck
            Jan 17 at 15:52











          • @slhck Thanks for the advice, I'll keep that in mind in the future.

            – kashveyron
            Jan 17 at 18:56














          0












          0








          0







          I have done it!



          I am not sure exactly what I did right, but I used these two commands:



          export LDFLAGS="-L/usr/local/opt/ruby/lib"



          export CPPFLAGS="-I/usr/local/opt/ruby/include"



          Then I tried:



          sudo gem install iStats



          and



          sudo gem install iStats -n /usr/local/bin



          Now I have successfully installed iStats 1.6.1.



          Strangely though, I used those two export commands earlier on and they did not do the trick. So something must have changed in the meantime, I don't know what it is.






          share|improve this answer













          I have done it!



          I am not sure exactly what I did right, but I used these two commands:



          export LDFLAGS="-L/usr/local/opt/ruby/lib"



          export CPPFLAGS="-I/usr/local/opt/ruby/include"



          Then I tried:



          sudo gem install iStats



          and



          sudo gem install iStats -n /usr/local/bin



          Now I have successfully installed iStats 1.6.1.



          Strangely though, I used those two export commands earlier on and they did not do the trick. So something must have changed in the meantime, I don't know what it is.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 17 at 15:45









          kashveyronkashveyron

          16114




          16114








          • 1





            Note that I recommend against messing with the system Ruby and instead installing rbenv: github.com/rbenv/rbenv – this should make your life easier, and you don't need to run sudo for anything.

            – slhck
            Jan 17 at 15:52











          • @slhck Thanks for the advice, I'll keep that in mind in the future.

            – kashveyron
            Jan 17 at 18:56














          • 1





            Note that I recommend against messing with the system Ruby and instead installing rbenv: github.com/rbenv/rbenv – this should make your life easier, and you don't need to run sudo for anything.

            – slhck
            Jan 17 at 15:52











          • @slhck Thanks for the advice, I'll keep that in mind in the future.

            – kashveyron
            Jan 17 at 18:56








          1




          1





          Note that I recommend against messing with the system Ruby and instead installing rbenv: github.com/rbenv/rbenv – this should make your life easier, and you don't need to run sudo for anything.

          – slhck
          Jan 17 at 15:52





          Note that I recommend against messing with the system Ruby and instead installing rbenv: github.com/rbenv/rbenv – this should make your life easier, and you don't need to run sudo for anything.

          – slhck
          Jan 17 at 15:52













          @slhck Thanks for the advice, I'll keep that in mind in the future.

          – kashveyron
          Jan 17 at 18:56





          @slhck Thanks for the advice, I'll keep that in mind in the future.

          – kashveyron
          Jan 17 at 18:56


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1395401%2fhaving-trouble-installing-ruby-gem-for-istats%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to make a Squid Proxy server?

          Is this a new Fibonacci Identity?

          19世紀