Troubles installing cocoapods for maven local iOS build

31 views
Skip to first unread message

P5music

unread,
May 1, 2021, 10:46:45 AM5/1/21
to CodenameOne Discussions
I am trying to create a local iOS build for my project with maven.
On my system (OSX Catilina) XCode is installed and
also xcodeproj
Now I am trying to install cocoapods
with
sudo gem install cocoapods

The output and the error log are provided, please see attached files.

I do not know if it is off-topic here but it is related to the maven migration for CN1 projects, so other users could beneficiate if they run into the same problems.
Thanks in advance
mkmf.log
console output for sudo gem install cocoapods.txt

Steve Hannah

unread,
May 1, 2021, 11:27:52 AM5/1/21
to codenameone...@googlegroups.com
You have to install the Xcode command-line tools.
Might be as simple as:
xcode-select --install

But if not, there is lots of info on this on Google, Stack Overflow, etc...

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/553fadb5-81e1-4efc-a1a9-589e538294ebn%40googlegroups.com.


--
Steve Hannah
Software Developer
Codename One

P5music

unread,
May 2, 2021, 3:20:45 AM5/2/21
to CodenameOne Discussions
if any developers end up being in need about this, here are some tricks.
-the xcode-select --install command maybe does not work so direct download is necessary from Apple website.
If you see "Can't download the software because of a network problem" then go to the website for
Xcode CommandLineTools
paying attention to pick the right release that the OSX version on your machine is compatible with.

-then you can get errors after the "sudo gem install cocoapods" command.
it deals with something like
In file included from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby.h:33: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby/ruby.h:24:10: fatal error: 'ruby/config.h' file not found #include "ruby/config.h"

Solution is at


but you may also need to edit the ruby.h in the deepest folder, where also the config.h should be located, so that
it reads
#include "config.h"
instead of
#include "ruby/config.h"

Warning there are two ruby.h files. One of them is the only h file in the upper level folder. I did not edit it, while
I edited the one that is one level deeper, where also the config.h is expected.

The SO solution make two aliases. The first alias is what I am talking about, I ended up copying the file instead of aliasing but I think because I attempted to create an alias manually in the wrong way. It is likely that the provided command works.

Then also a second alias has to be created, I copy/paste the command.
You may have to check the versions when adapting the command if different.

Regards
Reply all
Reply to author
Forward
0 new messages