मैं रूबी रत्न के माध्यम से iStats स्थापित करने की कोशिश कर रहा हूं।
पहले मैंने कमान चलाई:
xcode-select --install और आउटपुट था:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates। तो ठीक था।
फिर मैं भागा:
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 ./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
मुझे यकीन नहीं है कि इसका क्या मतलब है, लेकिन मुझे पता है कि यह काम नहीं किया। इसलिए मैंने रूबी का उपयोग करके स्थापित करने की कोशिश की:
brew install ruby, जो अपना काम कर रहा था।
फिर मैंने कोशिश की sudo gem फिर से कमांड करें लेकिन मुझे ऊपर जैसा ही आउटपुट मिला।
यहां क्या गलत हो रहा है?
संपादित करें:
मैंने अभी पढ़ा https://stackoverflow.com/a/26600110/6678549 और यह कोशिश की:
sudo gem update --system और यह आउटपुट मिला:
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
तो यह लगभग काम किया है, लेकिन मैं अभी भी iStats स्थापित करने के करीब नहीं हूँ।
संपादित करें 2:
मेरा माणिक संस्करण है ruby 2.3.7p456 यदि यह प्रासंगिक है और मैं MacOS Sierra का उपयोग कर रहा हूं। मैंने सिस्टम इंटिग्रिटी प्रोटेक्शन के बारे में थोड़ा-बहुत पढ़ना और पाया है। मैंने कुछ अन्य कमांड की कोशिश की है sudo gem install iStats -n /usr/local/bin, but still nothing works. Although after running sudo gem update --system` यह अब कहता है कि नवीनतम संस्करण पहले से स्थापित है।
rbenv: github.com/rbenv/rbenv - यह आपके जीवन को आसान बनाना चाहिए, और आपको चलाने की आवश्यकता नहीं हैsudoकिसी भी चीज के लिए।