code_explorer code_explorer - 1 year ago 39
iOS Question

"tns run ios --emulator" is throwing error "Command failed: /bin/sh -c ruby -e "require 'xcodeproj';"

This is in Mac and I am an absolute newbie.I am following Nativescript course in Pluralsight to get upto speed with App Development. I have installed all the pre-requisites (Xcode, nativescript, typescript etc.) as prescribed in the course.

I have created a very simple nativescript project with a button in the xml page. However when i run the command "tns run ios --emulator" in the terminal, I get the error

Command failed: /bin/sh -c ruby -e "require 'xcodeproj';'/Users/username/rps-conf/platforms/ios/plugins-debug.xcconfig').merge('/Users/username/rps-conf/app/App_Resources/iOS/build.xcconfig')).save_as('/Users/username/rps-conf/platforms/ios/plugins-debug.xcconfig'))"
Ignoring executable-hooks-1.3.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.3.2
Ignoring gem-wrappers-1.2.7 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.2.7

require': cannot load such file -- xcodeproj (LoadError)
from /Users/username/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in
from -e:1:in `'

I have a programming background (.Net) so I would like to understand what exactly is the problem rather than blindly trying out the automated instructions given in the terminal('try gem pristine etc.')

Answer Source

Check NativeScript installition is it correct... try tns doctor if its ok