9 Replies Last post: Oct 29, 2013 5:52 PM by Eloy Durán  
Daniel Dosen Newbie 14 posts since
Oct 10, 2013
Currently Being Moderated

Oct 10, 2013 2:00 AM

Can't Install CocoaPods

I use RVM for Ruby - and specific a version of Ruby local

to the project I'm workign on (noted in a .ruby-version file in the directory)

 

I've successfully installed cocoapods via the command line, outside of AppCode, but when I look at preferences in AppCode (in AppCode DEAP 131.284), It shows I don't have cocoapods installed

 

I therefore click on "Install Cocoapds" and get this error:

 

---

CocoaPods are not installed:

WARNING: You don't have      /Users/ddosen/.gem/ruby/2.0.0/bin in your PATH,
gem executables will      not run.
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      /Users/ddosen/.gem/ruby/2.0.0/gems/json-1.8.0 for inspection.
Results      logged to      /Users/ddosen/.gem/ruby/2.0.0/gems/json-1.8.0/ext/json/ext/generator/gem_make.out    

---

 

I manually added that directory to my path (which incidentally didn't exist) and I still get the error.

 

It seems like you're not finding the ruby I want... Can you advise?

 

Thanks in advance.  Looking forward to trying Kiwi from within AppCode

Dmitry Semeniouta Novice 80 posts since
Dec 17, 2012
Currently Being Moderated
Oct 10, 2013 6:29 PM in response to: Daniel Dosen
Re: Can't Install CocoaPods

Hello Daniel.

 

Currently there are couple of issues that prevents ApCode from correctly detecting and using CocoaPods in RVM environment (http://youtrack.jetbrains.com/issue/OC-8419 and http://youtrack.jetbrains.com/issue/OC-8246).

 

As for error during install it's a known issue with default Ruby 2.0 on OSX 10.9. There is a way to tweak your environment to install the gem:

 

1) Download and install Xcode 5 DP6 or 5.0.1 GM (apparently release version of Xcode 5 won't work since it doesn't include required SDK)

2) Make it default with "sudo xcode-select --switch <path_to_Xcode>/Contents/Developer"

3) Perform this fix https://gist.github.com/goshakkk/5763489

 

After that AC should be able to install CocoaPods.

 

Hope this solves your problem.

Dmitry Semeniouta Novice 80 posts since
Dec 17, 2012
Currently Being Moderated
Oct 11, 2013 3:51 PM in response to: Daniel Dosen
Re: Can't Install CocoaPods

This is a CocoaPods way to tell you that project doesn't satisfy pod's requirements. Make sure that your project's target platform is 10.7 or higher and install again. Alternatively you may install older version of Kiwi which supports older platforms.

Dmitry Semeniouta Novice 80 posts since
Dec 17, 2012
Currently Being Moderated
Oct 11, 2013 8:57 PM in response to: Daniel Dosen
Re: Can't Install CocoaPods

Developing on Mavericks has nothing to do with deployment target of your project. You may check the value of "OS X Deployment Target" in Xcode:

 

deployment_target_xcode.png

 

or in AppCode

 

deployment_target_appcode.png

Dmitry Semeniouta Novice 80 posts since
Dec 17, 2012
Currently Being Moderated
Oct 11, 2013 9:59 PM in response to: Daniel Dosen
Re: Can't Install CocoaPods

Thanks for you time on this - I'm just trying to get kiwi working.

 

No problem

 

The deployment target was set to "Compiler Default" for shared settings for all targets.  I've now set it to 10.9 - and still have the issue.

 

Please make sure that all targets of your project have 10.7 or higher in "Deployment Target..." too. You can find this setting in "Build Settings" tab of the target's section. It looks like this in Xcode

 

deployment_target_settings_xcode.png

 

Note - the error says the target platform of my "Pods" target is 10.6 - only I don't have a Pods target in my project.  Do you know what that's referring to?

 

CP creates a helper project "Pods" to keep all pods you use there. As far as I understand (and observe in my projects) this project's deployment target version is calculated as a minimal deployment version of original project's targets. CocoaPods then checks this version against pod's requirements and prints the message you've encountered if they don't match.

Eloy Durán Newbie 1 posts since
Oct 29, 2013
Currently Being Moderated
Oct 29, 2013 5:52 PM in response to: Dmitry Semeniouta
Re: Can't Install CocoaPods

Disclosure: I’m a CocoaPods core developer.

 

As a side note, since CocoaPods 0.27.1 we provide prebuilt binaries and no more Xcode CLI tools are needed. But these ONLY work when using the Ruby that comes pre-installed with OS X, NOT with custom rubies installed through, for instace, RVM.

 

For more information, see this blog post: http://blog.cocoapods.org/CocoaPods-0.27-and-improved-installation-UX/

More Like This

  • Retrieving data ...