I am having issues installing the gem motion-cocoapods on mavericks. I am using ruby 1.9.3-p484, OS X Mavericks, Xcode 5.1.
I found lots of solutions but none of them work.
Here is my error logs when trying to install
checking for -std=c99 option to compiler... yes
checking for CoreFoundation... no
checking for main() in -lCoreFoundation... no
CoreFoundation is needed to build the Xcodeproj C extension.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
xcode/mkmf.log file
checking for -std=c99 option to compiler... -------------------- yes
"/usr/local/opt/gcc46/bin/gcc-4.6 -o conftest -I/Users/**/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-darwin13.1.0 -I/Users/**/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/Users/**/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -fno-common -pipe conftest.c -L. -L/Users/**/.rvm/rubies/ruby-1.9.3-p484/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -lruby.1.9.1 -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
"/usr/local/opt/gcc46/bin/gcc-4.6 -I/Users/**/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-darwin13.1.0 -I/Users/**/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/Users/**/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -fno-common -pipe -std=c99 -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
/* end */
--------------------
have_framework: checking for CoreFoundation... -------------------- no
"/usr/local/opt/gcc46/bin/gcc-4.6 -o conftest -I/Users/**/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-darwin13.1.0 -I/Users/**/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/Users/**/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -fno-common -pipe -std=c99 conftest.c -L. -L/Users/**/.rvm/rubies/ruby-1.9.3-p484/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -lruby.1.9.1 -ObjC -framework CoreFoundation -lpthread -ldl -lobjc "
cc1: error: argument to '-O' should be a non-negative integer
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <CoreFoundation/CoreFoundation.h>
4:
5: int main(void){return 0;}
/* end */
--------------------
have_library: checking for main() in -lCoreFoundation... -------------------- no
"/usr/local/opt/gcc46/bin/gcc-4.6 -o conftest -I/Users/**/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-darwin13.1.0 -I/Users/**/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/Users/**/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -fno-common -pipe -std=c99 conftest.c -L. -L/Users/**/.rvm/rubies/ruby-1.9.3-p484/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -lruby.1.9.1 -lCoreFoundation -lpthread -ldl -lobjc "
conftest.c: In function 't':
conftest.c:4:53: error: 'main' undeclared (first use in this function)
conftest.c:4:53: note: each undeclared identifier is reported only once for each function it appears in
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
/* end */
"/usr/local/opt/gcc46/bin/gcc-4.6 -o conftest -I/Users/**/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/x86_64-darwin13.1.0 -I/Users/**/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/backward -I/Users/**/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -fno-common -pipe -std=c99 conftest.c -L. -L/Users/**/.rvm/rubies/ruby-1.9.3-p484/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -lruby.1.9.1 -lCoreFoundation -lpthread -ldl -lobjc "
conftest.c: In function 't':
conftest.c:4:1: warning: implicit declaration of function 'main' [-Wimplicit-function-declaration]
ld: library not found for -lCoreFoundation
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: int t() { main(); return 0; }
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: printf("%p", &t);
9: }
10:
11: return 0;
12: }
/* end */
--------------------
Here is some solutions I have tried
Reinstall Xcode & point to it
xcode-select -p
/Applications/Xcode.app/Contents/Developer
Ran the following command (command line tools for new 10.9 OSX for ruby gems?)
sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
Ran this command (https://github.com/CocoaPods/CocoaPods/issues/192)
CFLAGS="-F /System/Library/Frameworks" gem install motion-cocoapods -- --with-ldflags="-F/System/Library/Frameworks"