Tns prepare ios fails after upgrading Xcode


#1

I upgraded Xcode to 9.1, and now tns prepare ios fails with the following message:

Preparing project...
Command failed: ruby -e "require 'xcodeproj'; Xcodeproj::Config.new('/FourDAdmin/nativescript/platforms/ios/plugins-debug.xcconfig').merge(Xcodeproj::Config.new('/FourDAdmin/nativescript/app/App_Resources/iOS/build.xcconfig')).save_as(Pathname.new('/FourDAdmin/nativescript/platforms/ios/plugins-debug.xcconfig'))"
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- xcodeproj (LoadError)
        from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from -e:1:in `<main>'

I tried to remove that Ruby.Framework, but OSX does not allow me to do!

Any help is appreciated.

TIA
julio


#2

Right after I posted my topic I found the problem and a solution.
Looks like updating XCode does not refresh/updates the Cocoapods.

One has to force install them manually, by running this:

sudo gem install cocoapods -v 1.3.1

That did the trick and tns prepare ios now completes with no errors.

Hope this helps someone else.