Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid "Failed to build gem native extension" installation error by checking xcode-select #1402

Closed
rivera-ernesto opened this issue Sep 24, 2013 · 5 comments

Comments

@rivera-ernesto
Copy link
Contributor

I was trying to get some time to create a pull request to solve #1108, #1300, #1368, #1371, #1401 (and more to come...).

As I may not be able to do it soon I though a feature request would be better than nothing:

  • During installation of the gem Cocoapods should check the validity of the current xcode-select --print-path value.
  • If the current path points to a non-longer existent Xcode installation print an error message that would be more helpful than the current "Failed to build gem native extension" one.
  • Optionally if would be cool if the installer would search for the most common Xcode path (/Applications/Xcode.app/Contents/Developer) and offer to set it xcode-select --switch <xcode_path>.
@fabiopelosin
Copy link
Member

We don't control CocoaPods installation because it is performed by RubyGems. We are investigating solutions to ship a CocoaPods binary by version 1.0 (#400), but we are not there yet. Suggestions in that regard are very appreciated 🍻

A bandaid that we intend to implement is to ship the xcodeproj gem with the native extensions pre-built (CocoaPods/Xcodeproj#88). Any help in that regard would be very welcome as well.

You might want to forward this ticket to RubyGems as they might be interested in fine tuning the installation of gems with native extensions in OS X.

Closing as not actionable in CocoaPods

@rivera-ernesto
Copy link
Contributor Author

I have never made a gemspec but it sounded like you could embed a script:

Look familiar? The gemspec is also Ruby, so you can wrap scripts to generate the file names and bump the version number. There are lots of fields the gemspec can contain. To see them all check out the full reference.

But you're right. If the gem installation process is too restrictive then there's not much that can be done besides maybe a note/fix suggestion message.

@fabiopelosin
Copy link
Member

A script can be used to create the values of the gemspec. However they provide no hooks and they are later serialized to YAML.

Also the note message wouldn't work because it is presented only after a successful installation.

@rivera-ernesto
Copy link
Contributor Author

I see.

Then at least if the Cocoapods main page's Install section would have a note I think we would duplicated installation issues.

Something like:

Note: Common installation/update errors can be due to Xcode comand line tools not being installed or xcode-select path becoming invalid.

@fabiopelosin
Copy link
Member

The CocoaPods website is being completely overhauled. Not sure where that section will go but guides will be much more prominently featured and they already include information in that regard.

/c @mtitolo @orta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants