xcrun: error: SDK "iphoneos" cannot be located - react-native

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

Related

Unable To Install 'therubyracer v0.12.3' gem in M1 Macbook Pro

I am using M1 Macbook Pro and wants to install therubyracer and libv8 for a rails webapp. But I am unable to do so because of the errors described below. There are several solutions available on the internet but none of them is working for me.
Operating System: macOS Big Sur v11.1.
It would be very helpful if someone can help me with this.
Log:
❯ ruby -v
ruby 2.5.5p157 (2019-03-15 revision 67260) [-darwin20]
❯ bundle -v
Bundler version 1.17.3
❯ brew -v
Homebrew 2.7.5
Homebrew/homebrew-core (git revision e04a30; last commit 2021-01-20)
Homebrew/homebrew-cask (git revision d128de; last commit 2021-01-20)
❯ uname -a
Darwin Vaibhavs-MacBook-Pro.local 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec 2 20:40:21 PST 2020; root:xnu-7195.60.75~1/RELEASE_ARM64_T8101 arm64
❯ brew search v8
==> Formulae
v8 ✔ v8#3.15
==> Casks
amitv87-pip
❯ brew install v8#3.15
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> Updated Formulae
Updated 3 formulae.
==> Updated Casks
Updated 3 casks.
Error: v8#3.15: no bottle available!
You can try to install from source with:
brew install --build-from-source v8#3.15
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.
❯ brew install --build-from-source v8#3.15
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
==> Updated Casks
Updated 1 cask.
==> Cloning https://chromium.googlesource.com/external/gyp.git
Updating /Users/vaibhavgupta/Library/Caches/Homebrew/v8#3.15--gyp--git
==> Checking out revision f7bc250ccc4d619a1cf238db87e5979f89ff36d7
HEAD is now at f7bc250c Make gyp/win32 compatible with upstream ninja.
HEAD is now at f7bc250c Make gyp/win32 compatible with upstream ninja.
==> Downloading https://github.com/v8/v8-git-mirror/archive/3.15.11.18.tar.gz
Already downloaded: /Users/vaibhavgupta/Library/Caches/Homebrew/downloads/26ea05158c6c6ebb67cc42075858df9a986f9c615513933b1e62bb707f707854--v8-3.15.11.18.tar.gz
==> make native -j8 library=shared snapshot=on console=readline
Last 15 lines from /Users/vaibhavgupta/Library/Logs/Homebrew/v8#3.15/01.make:
Atomic32 Acquire_Load(volatile const Atomic32* ptr);
^
In file included from ../src/conversions.cc:32:
In file included from ../src/conversions-inl.h:42:
In file included from ../src/platform.h:100:
In file included from ../src/lazy-instance.h:94:
../src/once.h:115:7: error: no matching function for call to 'Acquire_Load'
if (Acquire_Load(once) != ONCE_STATE_DONE) {
^~~~~~~~~~~~
../src/atomicops.h:125:10: note: candidate function not viable: no known conversion from 'v8::internal::OnceType *' (aka 'long *') to 'const volatile v8::internal::Atomic32 *' (aka 'const volatile int *') for 1st argument
Atomic32 Acquire_Load(volatile const Atomic32* ptr);
^
5 errors generated.
make[1]: *** [/private/tmp/v8-3.15-20210120-4211-1soh8ig/v8-3.15.11.18/out/native/obj.target/preparser_lib/src/conversions.o] Error 1
make: *** [native] Error 2
Do not report this issue to Homebrew/brew or Homebrew/core!
❯ brew install v8
==> Downloading https://homebrew.bintray.com/bottles/v8-8.8.278.14.arm64_big_sur.bottle.tar.gz
Already downloaded: /Users/vaibhavgupta/Library/Caches/Homebrew/downloads/457adba5b4da5d7cb7d6d896218ebc5d8f1453782321e97a3df424f4a4e8a821--v8-8.8.278.14.arm64_big_sur.bottle.tar.gz
==> Pouring v8-8.8.278.14.arm64_big_sur.bottle.tar.gz
🍺 /opt/homebrew/Cellar/v8/8.8.278.14: 80 files, 39.9MB
❯ brew --prefix v8
/opt/homebrew/opt/v8
❯ gem install libv8 -v '3.16.14.19'
Fetching libv8-3.16.14.19.gem
Building native extensions. This could take a while...
ERROR: Error installing libv8:
ERROR: Failed to build gem native extension.
current directory: /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/ext/libv8
/Users/vaibhavgupta/.rvm/rubies/ruby-2.5.5/bin/ruby -I /Users/vaibhavgupta/.rvm/rubies/ruby-2.5.5/lib/ruby/site_ruby/2.5.0 -r ./siteconf20210120-6051-11xeqcl.rb extconf.rb
creating Makefile
Applying /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/patches/disable-building-tests.patch
Applying /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/patches/disable-werror-on-osx.patch
Applying /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/patches/disable-xcode-debugging.patch
Applying /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/patches/do-not-imply-vfp3-and-armv7.patch
Applying /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/patches/do-not-use-MAP_NORESERVE-on-freebsd.patch
Applying /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/patches/do-not-use-vfp2.patch
Applying /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/patches/fPIC-for-static.patch
Compiling v8 for arm
Using python 2.7.16
Using compiler: c++ (clang version 12.0.0)
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
Beginning compilation. This will take some time.
Building v8 with env CXX=c++ LINK=c++ /usr/bin/make arm.release vfp2=off vfp3=on hardfp=on ARFLAGS.target=crs werror=no
GYP_GENERATORS=make \
build/gyp/gyp --generator-output="out" build/all.gyp \
-Ibuild/standalone.gypi --depth=. \
-Dv8_target_arch=arm \
-S.arm -Dv8_enable_backtrace=1 -Dv8_can_use_vfp2_instructions=false -Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3 -Dwerror='' -Dv8_use_arm_eabi_hardfloat=true
CXX(target) /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/vendor/v8/out/arm.release/obj.target/preparser_lib/src/allocation.o
clang: warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from ../src/allocation.cc:33:
../src/utils.h:33:10: fatal error: 'climits' file not found
#include <climits>
^~~~~~~~~
1 error generated.
make[1]: *** [/Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/vendor/v8/out/arm.release/obj.target/preparser_lib/src/allocation.o] Error 1
make: *** [arm.release] Error 2
/Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive '/Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/vendor/v8/out/arm.release/obj.target/tools/gyp/libv8_base.a'to exist, but it was not found (Libv8::Location::Vendor::ArchiveNotFound)
from /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/ext/libv8/location.rb:35:in `each'
from /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/ext/libv8/location.rb:35:in `verify_installation!'
from /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/ext/libv8/location.rb:26:in `install!'
from extconf.rb:7:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19 for inspection.
Results logged to /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/extensions/-darwin-20/2.5.0/libv8-3.16.14.19/gem_make.out
❯ gem install libv8 -v '3.16.14.19' -- --with-system-v8
Building native extensions with: '--with-system-v8'
This could take a while...
Successfully installed libv8-3.16.14.19
Parsing documentation for libv8-3.16.14.19
Installing ri documentation for libv8-3.16.14.19
Done installing documentation for libv8 after 0 seconds
1 gem installed
❯ gem install therubyracer -v '0.12.3'
Building native extensions. This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
current directory: /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/therubyracer-0.12.3/ext/v8
/Users/vaibhavgupta/.rvm/rubies/ruby-2.5.5/bin/ruby -I /Users/vaibhavgupta/.rvm/rubies/ruby-2.5.5/lib/ruby/site_ruby/2.5.0 -r ./siteconf20210120-6195-ojni3j.rb extconf.rb
checking for -lpthread... yes
checking for -lobjc... yes
checking for v8.h... no
*** 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.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/vaibhavgupta/.rvm/rubies/ruby-2.5.5/bin/$(RUBY_BASE_NAME)
--with-pthreadlib
--without-pthreadlib
--with-objclib
--without-objclib
--enable-debug
--disable-debug
--with-v8-dir
--without-v8-dir
--with-v8-include
--without-v8-include=${v8-dir}/include
--with-v8-lib
--without-v8-lib=${v8-dir}/lib
/Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/ext/libv8/location.rb:50:in `configure': By using --with-system-v8, you have chosen to use the version (Libv8::Location::System::NotFoundError)
of V8 found on your system and *not* the one that is bundled with
the libv8 rubygem.
However, your system version of v8 could not be located.
Please make sure your system version of v8 that is compatible
with 3.16.14.19 installed. You may need to use the
--with-v8-dir option if it is installed in a non-standard location
from /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/lib/libv8.rb:7:in `configure_makefile'
from extconf.rb:32:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/extensions/-darwin-20/2.5.0/therubyracer-0.12.3/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/therubyracer-0.12.3 for inspection.
Results logged to /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/extensions/-darwin-20/2.5.0/therubyracer-0.12.3/gem_make.out
❯ gem install therubyracer -v '0.12.3' -- --with-v8-dir=/opt/homebrew/opt/v8
Building native extensions with: '--with-v8-dir=/opt/homebrew/opt/v8'
This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
current directory: /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/therubyracer-0.12.3/ext/v8
/Users/vaibhavgupta/.rvm/rubies/ruby-2.5.5/bin/ruby -I /Users/vaibhavgupta/.rvm/rubies/ruby-2.5.5/lib/ruby/site_ruby/2.5.0 -r ./siteconf20210120-6214-10f7ru2.rb extconf.rb --with-v8-dir\=/opt/homebrew/opt/v8
checking for -lpthread... yes
checking for -lobjc... yes
checking for v8.h... no
*** 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.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/vaibhavgupta/.rvm/rubies/ruby-2.5.5/bin/$(RUBY_BASE_NAME)
--with-pthreadlib
--without-pthreadlib
--with-objclib
--without-objclib
--enable-debug
--disable-debug
--with-v8-dir
--with-v8-include
--without-v8-include=${v8-dir}/include
--with-v8-lib
--without-v8-lib=${v8-dir}/lib
/Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/ext/libv8/location.rb:50:in `configure': By using --with-system-v8, you have chosen to use the version (Libv8::Location::System::NotFoundError)
of V8 found on your system and *not* the one that is bundled with
the libv8 rubygem.
However, your system version of v8 could not be located.
Please make sure your system version of v8 that is compatible
with 3.16.14.19 installed. You may need to use the
--with-v8-dir option if it is installed in a non-standard location
from /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/lib/libv8.rb:7:in `configure_makefile'
from extconf.rb:32:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/extensions/-darwin-20/2.5.0/therubyracer-0.12.3/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/therubyracer-0.12.3 for inspection.
Results logged to /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/extensions/-darwin-20/2.5.0/therubyracer-0.12.3/gem_make.out
❯ gem install therubyracer -v '0.12.3' -- --with-v8-dir=/opt/homebrew/opt/v8/libexec/
Building native extensions with: '--with-v8-dir=/opt/homebrew/opt/v8/libexec/'
This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
current directory: /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/therubyracer-0.12.3/ext/v8
/Users/vaibhavgupta/.rvm/rubies/ruby-2.5.5/bin/ruby -I /Users/vaibhavgupta/.rvm/rubies/ruby-2.5.5/lib/ruby/site_ruby/2.5.0 -r ./siteconf20210120-6235-1hlxxtd.rb extconf.rb --with-v8-dir\=/opt/homebrew/opt/v8/libexec/
checking for -lpthread... yes
checking for -lobjc... yes
checking for v8.h... no
*** 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.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/vaibhavgupta/.rvm/rubies/ruby-2.5.5/bin/$(RUBY_BASE_NAME)
--with-pthreadlib
--without-pthreadlib
--with-objclib
--without-objclib
--enable-debug
--disable-debug
--with-v8-dir
--with-v8-include
--without-v8-include=${v8-dir}/include
--with-v8-lib
--without-v8-lib=${v8-dir}/lib
/Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/ext/libv8/location.rb:50:in `configure': By using --with-system-v8, you have chosen to use the version (Libv8::Location::System::NotFoundError)
of V8 found on your system and *not* the one that is bundled with
the libv8 rubygem.
However, your system version of v8 could not be located.
Please make sure your system version of v8 that is compatible
with 3.16.14.19 installed. You may need to use the
--with-v8-dir option if it is installed in a non-standard location
from /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/libv8-3.16.14.19/lib/libv8.rb:7:in `configure_makefile'
from extconf.rb:32:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/extensions/-darwin-20/2.5.0/therubyracer-0.12.3/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/gems/therubyracer-0.12.3 for inspection.
Results logged to /Users/vaibhavgupta/.rvm/gems/ruby-2.5.5/extensions/-darwin-20/2.5.0/therubyracer-0.12.3/gem_make.out
This works for me:
Ruby version: 2.6.1
OS version: macOS Big Sur 11.2
Install HomeBrew using Rosetta Termina
https://5balloons.info/correct-way-to-install-and-use-homebrew-on-m1-macs/
brew install v8#3.15
gem install libv8 -v '3.16.14.19' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8#3.15
I fixed this by installing V8 on Rosseta 2 as V8 not yet supported for ARM.
You can try this
gem install therubyracer -v '0.12.3' --
--with-v8-dir=/usr/local/opt/v8#3.15
Or install V8 on Rosseta 2.
Update: How to install ruby in x86_64 for M1.
Install homebrew in x86_64. Please refer to this guide How to install ruby on m1
Install ASDF using x86_64
Install all other dependencies on x86_64 only such as postgres, redis, and V8 using x86_64 only.

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
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

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

openssl / ctls trouble with vapor 2

How can I fix these OpenSSL / TLS issues I'm getting with Vapor 2? They are preventing me from compiling my project on the command line and in Xcode.
During SPM build:
note: you may be able to install ctls using your system-packager:
brew install ctls
note: you may be able to install ctls using your system-packager:
brew install openssl
Upon failure of SPM build:
Linking ./.build/debug/Run
ld: library not found for -lcrypto for architecture x86_64
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: build had 1 command failures
error: exit(1): /Library/Developer/Toolchains/swift-3.1-DEVELOPMENT-SNAPSHOT-2017-03-07-a.xctoolchain/usr/bin/swift-build-tool -f /Users/tanner/Desktop/PackageConfig/.build/debug.yaml
Also in SPM:
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "shim.h"
^
/Users/tanner/Desktop/PackageConfigTwo/.build/checkouts/ctls.git-9210868160426949823/shim.h:4:10: error: 'openssl/conf.h' file not found
#include <openssl/conf.h>
^
/Users/tanner/Desktop/PackageConfigTwo/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Cipher/Cipher+Method.swift:1:8: error: could not build Objective-C module 'CTLS'
import CTLS
^
In Xcode:
/Users/tanner/PackageConfig/.build/checkouts/ctls.git-9210868160426949823/shim.h:4:10: 'openssl/conf.h' file not found
/Users/tanner/PackageConfig/.build/checkouts/crypto.git-7980259129511365902/Sources/Crypto/Cipher/Cipher+Method.swift:1:8: Could not build Objective-C module 'CTLS'
ld: library not found for -lssl
This error means OpenSSL is either not installed or not being properly linked. There are three solutions to this problem.
Option 1: Use Vapor Toolbox (Recommended)
Install the latest version of the Vapor toolbox.
If you have already installed the toolbox, try uninstalling it first:
which vapor
rm -rf /path/to/vapor
1.1 Install (macOS)
Add Vapor's Homebrew Tap
brew tap vapor/homebrew-tap
Update Homebrew and install the toolbox.
brew update
brew install vapor
1.2 Install (Ubuntu)
Add Vapor's APT repo.
Quick Script
eval "$(curl -sL https://apt.vapor.sh)"
Manual
wget -q https://repo.vapor.codes/apt/keyring.gpg -O- | sudo apt-key add -
echo "deb https://repo.vapor.codes/apt $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/vapor.list
Install
sudo apt-get update
sudo apt-get install vapor
1.3 Done
You should now have access to the vapor program and all required dependencies should be installed.
vapor build
vapor xcode
swift build and related commands should now also work normally.
swift build
swift package generate-xcodeproj
Option 2: Install Vapor's CTLS Package
2.1 Install (macOS)
Add Vapor's Homebrew Tap
brew tap vapor/homebrew-tap
Update Homebrew and install CTLS
brew update
brew install ctls
Restart your terminal, re-generate your Xcode project (if using Xcode), and try again.
2.2 Install (Ubuntu)
Add Vapor's APT repo.
Quick Script
eval "$(curl -sL https://apt.vapor.sh)"
Manual
wget -q https://repo.vapor.codes/apt/keyring.gpg -O- | sudo apt-key add -
echo "deb https://repo.vapor.codes/apt $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/vapor.list
Update APT and install CTLS.
sudo apt-get update
sudo apt-get install ctls
2.3 Done
swift build and other commands should now work normally.
Option 3: Manually Install and Link OpenSSL or Equivalent
3.1 Install (macOS)
Install OpenSSL (or any other similar SSL library)
brew install openssl
brew install libressl
3.2 Install (Ubuntu)
Install OpenSSL (or any other similar SSL library)
sudo apt-get install libssl-dev
3.3 Finding Linker Flags
You can use pkg-config (available on brew and apt) to find linker flags or most packages.
pkg-config <package-name> --cflags
pkg-config <package-name> --libs
However, OpenSSL installed through Homebrew cannot be linked and thus does not work with pkg-config. These flags should work:
include: /usr/local/opt/openssl/include
libs: /usr/local/opt/openssl/lib
Note, some libraries will be installed into /usr/include and /usr/lib which does not require explicit linker flags. OpenSSL through APT is installed this way.
3.4 Using Linker Flags
Linker flags can be added during swift build
swift build -Xswiftc -I/path/to/include -Xlinker -L/path/to/lib
They can also be added during Xcode project generation.
swift package -Xswiftc -I/path/to/include -Xlinker -L/path/to/lib generate-xcodeproj
#tanner0101 your suggestions here https://github.com/vapor/vapor/issues/937 have not resolved the issue for me. I get the CTLS is missing error not only on High Sierra but also on Ubuntu inside a Docker container.
The project is manually executable but MySQL does not work. I think that this https://github.com/vapor/vapor/issues/954 and this https://github.com/uchicago-cloud/mpcs51033-2017-spring-forum/issues/54 are not just deployment on Heroku issues.

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