CocoaPods / cocoapods-acknowledgements

CocoaPods plugin that generates a plist which includes the installation metadata
MIT License
111 stars 17 forks source link

Not able to install gems on OS X EL Capitan 10.14.1 #50

Open stevelyc opened 6 years ago

stevelyc commented 6 years ago

Building native extensions. This could take a while... ERROR: Error installing cocoapods-acknowledgements: ERROR: Failed to build gem native extension.

current directory: /Library/Ruby/Gems/2.3.0/gems/redcarpet-3.4.0/ext/redcarpet

/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20181108-31503-or1xzs.rb extconf.rb creating Makefile

current directory: /Library/Ruby/Gems/2.3.0/gems/redcarpet-3.4.0/ext/redcarpet make "DESTDIR=" clean

current directory: /Library/Ruby/Gems/2.3.0/gems/redcarpet-3.4.0/ext/redcarpet 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 byautolink.o'. Stop.

make failed, exit code 2

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

winkelsdorf commented 5 years ago

Has to do with the restricted permissions on system folders. It is not suggested to install or update system gems, better use a ruby version manager like https://github.com/rbenv/rbenv.

If you're using homebrew you can install rbenv using: brew install rbenv

Then add it to your bash profile (in my case zsh: ~/.zshrc):

# init rbenv
eval "$(rbenv init -)"

Use rbenv install and rbenv global to specify the ruby version you want to use then.

After this installation works fine for all gems like e.g. bundler, cocoapods or fastlane.

hth!