here is the error:
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/json-1.8.1 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
i've search on google for the last 7 hours and i can't find a solution that works for me. i have tried them all
Please help me up
edit: *after installing the RVM i stil get the same error
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/json-1.8.1 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
using this command line : sudo gem install cocoapods
To find if Cocoapods is installed or not run cmd (pod --version). if theresult is (Not Found) Pods is not installed.
You're on Mac OS. To get:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h
you're trying to install gems into your system Ruby, which was installed by Apple for their use.
Don't do that.
Instead, use either rbenv or RVM to manage/install Rubies in a separate sandbox, where you're free to fold/spindle/mutilate to your heart's content.
If you opt for RVM, *read the ENTIRE installation instructions* before starting. RVM is very full-featured, and flexible, and those come at a price of additional "options" (AKA "complexity") when installing. Do it as a single-user, do not EVER use sudo
, and you should be fine.
We can piggyback on Apple's system-instalation of Ruby, but don't modify it unless you really understand what you're doing; The error above makes me think this isn't the case.
To install a Ruby other than Apple's pre-installed one, odds are really good you'll need the current Xcode, along with the command-line extensions. That will provide the tools necessary to compile native extensions, plus all the headers needed:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With