moe safar
moe safar

Reputation: 150

Pod install problem with React Native on macOS

I’m running the latest version of react native, whenever I create a new project through the terminal, I receive a message saying that I have to install pods manually by going to the iOS folder. When I do so, the pod install fails. I’ve tried running ‘sudo gem install’ and deleting and reinstalling react native.

This is the error I'm getting now when trying to run rbenv:

BUILD FAILED (OS X 10.15.1 using ruby-build 20191111)

Inspect or clean up the working tree at /var/folders/rh/5076xlbn4g9gzkvwk1wkjg400000gn/T/ruby-build.20191120204401.79920.wx7t9i
Results logged to /var/folders/rh/5076xlbn4g9gzkvwk1wkjg400000gn/T/ruby-build.20191120204401.79920.log

Last 10 log lines:
*** building:

    make depend
making all in crypto...
/usr/bin/perl ../util/mkbuildinf.pl "clang -I. -I.. -I../include  -fPIC -fno-common -DOPENSSL_PIC -DZLIB_SHARED -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM" "darwin64-x86_64-cc" >buildinf.h
clang -I. -I.. -I../include  -fPIC -fno-common -DOPENSSL_PIC -DZLIB_SHARED -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -I/Users/User1/.rbenv/versions/2.2.4/include   -c -o cryptlib.o cryptlib.c
/bin/sh: User1/.rbenv/versions/2.2.4/include: No such file or directory
make[1]: *** [cryptlib.o] Error 127
make: *** [build_crypto] Error 1
clang: error: no input files

This is the $HOME directory

Upvotes: 0

Views: 6752

Answers (1)

Hurobaki
Hurobaki

Reputation: 4058

I have already faced this problem. I don't know why, but the default Ruby version on mac causes problems.

To get over this, I use Rbenv which is Ruby versions manager.

Here's how to install it

brew install rbenv

In your bash_profile or bashrc or zshrc whatever put this code and don't forget to source your file

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

Install a Ruby version with rbenv different from your actual version to be sure rbenv works.

rbenv install 2.5.3
rbenv global 2.5.3
rbenv rehash
ruby -v //ensure that you're now using 2.5.3 version
gem install cocoapods

Delete your Pods/ Podfile.lock and try to run pod install again. It should do the trick. As I said, it worked for me and the members of my project team. You must remember not to use sudo.

Keep me in touch I can provide clarification if you're stuck

Upvotes: 1

Related Questions