Pod install problem with React Native on macOS - react-native

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

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

Related

xcrun: error: SDK "iphoneos" cannot be located

I'm not experienced so I can't really pinpoint what is the problem. Thanks for the help.
I cloned this repo: https://github.com/flatlogic/react-native-starter.git
And was trying to follow the steps below:
Clone the repo
git clone https://github.com/flatlogic/react-native-starter.git
Navigate to clonned folder and Install dependencies
cd react-native-starter && yarn install
Install Pods
cd ios && pod install
When I got to the pod install I'm getting that error.
karar#Karars-MacBook-Air ios % pod install
Auto-linking React Native modules for target `ReactNativeStarter`: BVLinearGradient, RNCMaskedView, RNGestureHandler, RNLocalize, RNReanimated, RNScreens, RNVectorIcons, ReactNativeUiLib, react-native-safe-area-context, and toolbar-android
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Downloading dependencies
Installing BVLinearGradient (2.5.6)
Installing DoubleConversion (1.1.6)
Installing FBLazyVector (0.63.1)
Installing FBReactNativeSpec (0.63.1)
Installing Folly (2020.01.13.00)
Installing RCTRequired (0.63.1)
Installing RCTTypeSafety (0.63.1)
Installing RNCMaskedView (0.1.10)
Installing RNGestureHandler (1.8.0)
Installing RNLocalize (1.4.2)
Installing RNReanimated (1.13.1)
Installing RNScreens (2.11.0)
Installing RNVectorIcons (6.7.0)
Installing React (0.63.1)
Installing React-Core (0.63.1)
Installing React-CoreModules (0.63.1)
Installing React-RCTActionSheet (0.63.1)
Installing React-RCTAnimation (0.63.1)
Installing React-RCTBlob (0.63.1)
Installing React-RCTImage (0.63.1)
Installing React-RCTLinking (0.63.1)
Installing React-RCTNetwork (0.63.1)
Installing React-RCTSettings (0.63.1)
Installing React-RCTText (0.63.1)
Installing React-RCTVibration (0.63.1)
Installing React-callinvoker (0.63.1)
Installing React-cxxreact (0.63.1)
Installing React-jsi (0.63.1)
Installing React-jsiexecutor (0.63.1)
Installing React-jsinspector (0.63.1)
Installing ReactCommon (0.63.1)
Installing ReactNativeUiLib (3.41.0)
Installing Yoga (1.14.0)
Installing boost-for-react-native (1.63.0)
Installing glog (0.3.5)
[!] /bin/bash -c
set -e
#!/bin/bash
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
set -e
PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}"
CURRENT_ARCH="${CURRENT_ARCH}"
if [ -z "$CURRENT_ARCH" ] || [ "$CURRENT_ARCH" == "undefined_arch" ]; then
# Xcode 10 beta sets CURRENT_ARCH to "undefined_arch", this leads to incorrect linker arg.
# it's better to rely on platform name as fallback because architecture differs between simulator and device
if [[ "$PLATFORM_NAME" == *"simulator"* ]]; then
CURRENT_ARCH="x86_64"
else
CURRENT_ARCH="armv7"
fi
fi
export CC="$(xcrun -find -sdk $PLATFORM_NAME cc) -arch $CURRENT_ARCH -isysroot $(xcrun -sdk $PLATFORM_NAME --show-sdk-path)"
export CXX="$CC"
# Remove automake symlink if it exists
if [ -h "test-driver" ]; then
rm test-driver
fi
./configure --host arm-apple-darwin
# Fix build for tvOS
cat << EOF >> src/config.h
/* Add in so we have Apple Target Conditionals */
#ifdef __APPLE__
#include <TargetConditionals.h>
#include <Availability.h>
#endif
/* Special configuration for AppleTVOS */
#if TARGET_OS_TV
#undef HAVE_SYSCALL_H
#undef HAVE_SYS_SYSCALL_H
#undef OS_MACOSX
#endif
/* Special configuration for ucontext */
#undef HAVE_UCONTEXT_H
#undef PC_FROM_UCONTEXT
#if defined(__x86_64__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip
#elif defined(__i386__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip
#endif
EOF
# Prepare exported header include
EXPORTED_INCLUDE_DIR="exported/glog"
mkdir -p exported/glog
cp -f src/glog/log_severity.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/raw_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/stl_logging.h "$EXPORTED_INCLUDE_DIR/"
cp -f src/glog/vlog_is_on.h "$EXPORTED_INCLUDE_DIR/"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-apple-darwin-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for arm-apple-darwin-gcc... /Library/Developer/CommandLineTools/usr/bin/cc -arch armv7 -isysroot
checking whether the C compiler works... no
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'
/Users/karar/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-40a13/missing: Unknown `--is-lightweight' option
Try `/Users/karar/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-40a13/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/Users/karar/Library/Caches/CocoaPods/Pods/External/glog/2263bd123499e5b93b5efe24871be317-40a13':
configure: error: C compiler cannot create executables
See `config.log' for more details
karar#Karars-MacBook-Air ios %
Launch xcode
Preferences
Locations
Make sure there's a dropdown option selected for the command line tools.
Fixed it for me.
fixed with:
This related to those two issues https://github.com/facebook/react-native/issues/18408 https://github.com/facebook/react-native/issues/18408
so here is what works for me:
sudo xcode-select --switch /Applications/Xcode.app
I think your pod install working fine and has done its job. You need to set up iPhone SDK on your mac then try to run cd ../ && react-native run-ios.
Follow this guide : React Native Environment set up on Mac OS with Xcode and Android Studio

Apache Httpd Build from source: fatal error: expat.h: No such file or directory

I am trying to build Apache Server v 2.4.38 on RHEL 7.3 and I am using apr 1.6.5, apr-util 1.6.1, and pcre 8.42.
I am running following commands
./configure --with-included-apr --with-pcre=/data/abc/installed/pcre_installed --prefix=/data/abc/installed/httpd_installed
make
While running 'make' I am receiving error
/bin/sh /data/abc/installed/httpd-2.4.38/srclib/apr/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/data/abc/installed/httpd-2.4.38/srclib/apr-util/include -I/data/abc/installed/httpd-2.4.38/srclib/apr-util/include/private -I/data/abc/installed/httpd-2.4.38/srclib/apr/include -o xml/apr_xml.lo -c xml/apr_xml.c && touch xml/apr_xml.lo
xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory
#include <expat.h>
Download expat-2.2.6.tar.bz2 from https://libexpat.github.io/.
Extract expat using following command
tar xvjf expat-2.2.6.tar.bz2 -C /path-to-dir
Change to the extracted expat directory.
Build expat using following commands
./configure --prefix=/path-to-expat-installation-dir
make
make install
While building Apache Httpd from source specify --with-expat
./configure --with-included-apr --prefix=/path-to-apache-installation --with-expat=/path-to-expat-installation-dir
For anyone else coming across this:
OP had to do this because they didn't have sudo access. If you do, usually you don't need to download the source of expat manually; installing via package manager is way easier. Unless the software you are compiling requires a newer version of expat than your RPM repos provide.
So for the RHEL family of OSes you can just do sudo <dnf|yum> install expat expat-devel, then proceed with what you were compiling.
Do you have the expat library installed? (Because that's where the expat.h comes from.)
https://libexpat.github.io/
If you cannot install it globally to the system, I'm sure Apache's ./configure script must have an option to support a custom location for the library as well.
Tried In Ubuntu
apt install libexpat1-dev
For RHEL, I would suggest #cyqsimon's answer

install mlpy 3.5.0 on mac 10.9 error.Please help me

The following is the error which I am getting. Please help me to fix it.
apple:mlpy-3.5.0 apple$ python setup.py install
running install
running build
running build_py
running build_ext
building 'mlpy.gsl' extension
cc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c mlpy/gsl/gsl.c -o build/temp.macosx-10.9-intel-2.7/mlpy/gsl/gsl.o
mlpy/gsl/gsl.c:223:10: fatal error: 'gsl/gsl_sf.h' file not found
#include "gsl/gsl_sf.h"
^
1 error generated.
MLPy depends on GNU Scientific Library (GSL), which you need to install first.
You can install it either with brew install gsl or manually from source.
For manual installation, instructions can be found here. The relevant steps are as follows:
go to: http://www.gnu.org/prep/ftp.html
click on an ftp link close to your location
find the gsl/ directory and click on it
find the gsl-VERSION.tar.gz file, where version is 1.14 or greater. Click on that file to download it.
In a terminal window extract the tar.gz file using tar -xzf gsl-VERSION.tar.gz and then cd to the ./gsl-VERSION directory
Look at the INSTALL file. It will probably tell you to run ./configure, then make, and then make install (and you might have to
login as the superuser (sudo)
I am actually getting the same issue today while installing mlpy. Based on the mlpy documentation. Here is the method to solve this issue.
According to the installation section in the mlpy documentation:
If the GSL header files or shared library are in non-standard locations on your system, use the --include-dirs
and --rpath options to build_ext:
$ python setup.py build_ext --include-dirs=/path/to/header --rpath=/path/to/lib
$ python setup.py install
We have to assign the header and lib. Based on How to obtain and install GSL,
Under Search Paths/Header Search Paths type /opt/local/include
Under Search Paths/Library Search Paths type /opt/local/lib
The quick answer is running the below command:
sudo python setup.py build_ext --include-dirs=/opt/local/include --rpath=/opt/local/lib
sudo python setup.py install
Hope this will be helpful.

brew install sshfs

I'm trying to install sshfs using homebrew. Any ideas on how to troubleshoot?
~/Desktop> brew install sshfs
==> Installing sshfs dependency: fuse4x
==> Downloading https://github.com/fuse4x/fuse/tarball/fuse4x_0_9_1
Already downloaded: /Library/Caches/Homebrew/fuse4x-0.9.1.tgz
==> autoreconf --force --install
aclocal: error: aclocal: file '/usr/local/share/aclocal/mysql.m4' does not exist
autoreconf: aclocal failed with exit status: 1
==> Build Environment
HOMEBREW_VERSION: 0.9.2
HEAD: e3d609903576d1902240532b27b8e136d93af42b
CPU: 8-core 64-bit ivybridge
OS X: 10.7.4-x86_64
Xcode: 4.3.3
CLT: 1.0.0.9000000000.1.1249367152
X11: 2.6.4 # /usr/X11
CC: /usr/bin/clang
CXX: /usr/bin/clang++ => /usr/bin/clang
LD: /usr/bin/clang
CFLAGS: -Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.7 -arch i386 -arch x86_64
CXXFLAGS: -Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.7 -arch i386 -arch x86_64
CPPFLAGS: -I/usr/local/Cellar/gettext/0.18.1.1/include -I/usr/local/Cellar/libtool/2.4.2/include -I/usr/local/Cellar/automake/1.12.2/include -I/usr/local/Cellar/autoconf/2.69/include -isystem /usr/local/include
LDFLAGS: -L/usr/local/Cellar/gettext/0.18.1.1/lib -L/usr/local/Cellar/libtool/2.4.2/lib -L/usr/local/Cellar/automake/1.12.2/lib -L/usr/local/Cellar/autoconf/2.69/lib -L/usr/local/lib -arch i386 -arch x86_64
MACOSX_DEPLOYMENT_TARGET: 10.7
MAKEFLAGS: -j8
Error: Failed executing: autoreconf --force --install (fuse4x.rb:18)
These existing issues may help you:
https://github.com/mxcl/homebrew/issues/12266
https://github.com/mxcl/homebrew/issues/13647
Otherwise, this may help you fix or report the issue:
https://github.com/mxcl/homebrew/wiki/bug-fixing-checklist
~/Desktop> sudo brew install sshfs
Password:
Cowardly refusing to `sudo brew install'
It gave you two links to existing issues related to the error you are receiving. You should visit those links and see if they help you resolve the issue:
https://github.com/mxcl/homebrew/issues/12266
https://github.com/mxcl/homebrew/issues/13647
You should not be using sudo when installing things via homebrew.
I was having exactly the same problem and solved it by first running
brew update
as suggested here:
https://github.com/mxcl/homebrew/wiki/bug-fixing-checklist

Installing Homebrew, libjpeg, and optipng for HTML5 Boilerplate build tool use

Dipping my toe into command prompts.. totally lost.
I've installed Homebrew, and attempted to install libjpeg and optipng via brew install libjpeg optipngand have run into errors. I'm not sure how exactly to describe them.. so here's the code! I'm in Terminal on a Mac running OSX 10.6.7
Thank you SO much for the help.
1961:~ Daniel$ brew install libjpeg optipng
==> Downloading http://www.ijg.org/files/jpegsrc.v8c.tar.gz
File already downloaded and cached to /Users/Daniel/Library/Caches/Homebrew
==> ./configure --prefix=/usr/local/Cellar/jpeg/8c --disable-dependency-tracking
checking build system type... i386-apple-darwin10.7.3
checking host system type... i386-apple-darwin10.7.3
checking target system type... i386-apple-darwin10.7.3
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking for style of include used by make... none
checking for gcc... /usr/bin/cc
checking whether the C compiler works... no
configure: error: in `/private/tmp/homebrew-jpeg-8c-42or/jpeg-8c':
configure: error: C compiler cannot create executables
See `config.log' for more details
==> Exit Status: 77
http://github.com/mxcl/homebrew/blob/master/Library/Formula/jpeg.rb#L11
==> Environment
HOMEBREW_VERSION: 0.8
HEAD: (none)
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: 8-core 64-bit dunno
OS X: 10.6.7
Kernel Architecture: x86_64
Ruby: 1.8.7-174
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Xcode:
GCC-4.0: N/A
GCC-4.2: N/A
LLVM: build 2335
MacPorts or Fink? false
X11 installed? true
==> Build Flags
CC: /usr/bin/cc
CXX: /usr/bin/c++
LD: /usr/bin/cc
CFLAGS: -O3 -w -pipe -arch i386 -arch x86_64
CXXFLAGS: -O3 -w -pipe -arch i386 -arch x86_64
LDFLAGS: -arch i386 -arch x86_64
MAKEFLAGS: -j8
Error: Failed executing: ./configure --prefix=/usr/local/Cellar/jpeg/8c --disable-dependency-tracking
Please report this bug: https://github.com/mxcl/homebrew/wiki/new-issue
These existing issues may help you:
https://github.com/mxcl/homebrew/issues/#issue/4442
It looks like an autotools configure failed.
Consider re-running the install with '-vd' to keep 'config.log' around:
brew install -vd jpeg
Gist 'config.log' and any error output when reporting an issue.
Remember to include your config information: brew --config
Also try:
`brew doctor` to check your setup for common problems.
`brew missing` to check installed packages for missing deps.
1961:~ Daniel$ brew doctor
We couldn't detect gcc 4.2.x. Some formulae require this compiler.
We couldn't detect gcc 4.0.x. Some formulae require this compiler.
/usr/bin is in your PATH before Homebrew's bin. This means that system-
provided programs will be used before Homebrew-provided ones. This is an
issue if you install, for instance, Python.
Consider editing your .bashrc to put:
/usr/local/bin
ahead of /usr/bin in your $PATH.
Some brews install binaries to sbin instead of bin, but Homebrew's
sbin was not found in your path.
Consider editing your .bashrc to add:
/usr/local/sbin
to $PATH.
"Git" was not found in your path.
Homebrew uses Git for several internal functions, and some formulae
use Git checkouts instead of stable tarballs.
You may want to do:
brew install git
You have an "autoconf" in your path blocking the system version at:
Custom autoconf in general and autoconf 2.66 in particular has issues
and will cause some Homebrew formulae to fail.
1961:~ Daniel$ brew install git
==> Downloading http://kernel.org/pub/software/scm/git/git-1.7.5.tar.bz2
######################################################################## 100.0%
==> make prefix=/usr/local/Cellar/git/1.7.5 install
==> Exit Status: 1
http://github.com/mxcl/homebrew/blob/master/Library/Formula/git.rb#L31
==> Environment
HOMEBREW_VERSION: 0.8
HEAD: (none)
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: 8-core 64-bit dunno
OS X: 10.6.7
Kernel Architecture: x86_64
Ruby: 1.8.7-174
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Xcode:
GCC-4.0: N/A
GCC-4.2: N/A
LLVM: build 2335
MacPorts or Fink? false
X11 installed? true
==> Build Flags
CC: /usr/bin/cc
CXX: /usr/bin/c++
LD: /usr/bin/cc
CFLAGS: -O3 -w -pipe
CXXFLAGS: -O3 -w -pipe
MAKEFLAGS: -j8
Error: Failed executing: make prefix=/usr/local/Cellar/git/1.7.5 install
Please report this bug: https://github.com/mxcl/homebrew/wiki/new-issue
Also try:
`brew doctor` to check your setup for common problems.
`brew missing` to check installed packages for missing deps.
1961:~ Daniel$ brew missing
1961:~ Daniel$ brew doctor
We couldn't detect gcc 4.2.x. Some formulae require this compiler.
We couldn't detect gcc 4.0.x. Some formulae require this compiler.
/usr/bin is in your PATH before Homebrew's bin. This means that system-
provided programs will be used before Homebrew-provided ones. This is an
issue if you install, for instance, Python.
Consider editing your .bashrc to put:
/usr/local/bin
ahead of /usr/bin in your $PATH.
Some brews install binaries to sbin instead of bin, but Homebrew's
sbin was not found in your path.
Consider editing your .bashrc to add:
/usr/local/sbin
to $PATH.
"Git" was not found in your path.
Homebrew uses Git for several internal functions, and some formulae
use Git checkouts instead of stable tarballs.
You may want to do:
brew install git
You have an "autoconf" in your path blocking the system version at:
Custom autoconf in general and autoconf 2.66 in particular has issues
and will cause some Homebrew formulae to fail.
Try downloading and installing the Xcode development suite: http://developer.apple.com/xcode/
That will provide gcc (complier) to build the software