on 04-18-2022 6:35 AM
While building the project we are getting the below error. Can you please help with this.
Command failed: ruby -e "require 'xcodeproj'; Xcodeproj::Config.new('/Users/garvitsingh/SAM Dev/platforms/ios/plugins-debug.xcconfig').merge(Xcodeproj::Config.new('/Users/garvitsingh/SAM Dev/node_modules/@nativescript-rtl/ui/platforms/ios/build.xcconfig')).save_as(Pathname.new('/Users/garvitsingh/SAM Dev/platforms/ios/plugins-debug.xcconfig'))"
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require': cannot load such file -- xcodeproj (LoadError)
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from -e:1:in `<main>'
Error: Failed to run tns prepare ios
I was able to resolved this with below step:
Install ruby in case it is missing
brew install ruby
add ruby to the path runecho 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> /Users/user_name/.bash_profile
for compiler: export LDFLAGS="-L/usr/local/opt/ruby/lib"
export CPPFLAGS="-I/usr/local/opt/ruby/include"
Follow the instructions to set PATH. Replace user_name with your PC username:echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> /Users/user_name/.bash_profile
echo 'export LDFLAGS="-L/usr/local/opt/ruby/lib"' >> ~/.bash_profile
echo 'export CPPFLAGS="-I/usr/local/opt/ruby/include"' >> ~/.bash_profile
source ~/.bash_profile
Check your path:ruby -v
ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.x86_64-darwin21]
% which ruby
/usr/local/opt/ruby/bin/ruby
reinstall cocoapods or xcodeprojsudo gem install cocoapods -v {version no.}
sudo gem install xcodeproj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.