Skip to content

Command failed: ruby -e "require 'xcodeproj' #10456

@jarrodwhitley

Description

@jarrodwhitley

Issue Description

Command failed: ruby -e "require 'xcodeproj';
		userConfig = Xcodeproj::Config.new('/Users/jwhitley/Code/myhighland-app/platforms/ios/plugins-debug.xcconfig')
		existingConfig = Xcodeproj::Config.new('/Users/jwhitley/Code/myhighland-app/App_Resources/iOS/build.xcconfig')
		userConfig.attributes.each do |key,|
  			existingConfig.attributes.delete(key) if (userConfig.attributes.key?(key) && existingConfig.attributes.key?(key))
		end
		userConfig.merge(existingConfig).save_as(Pathname.new('/Users/jwhitley/Code/myhighland-app/platforms/ios/plugins-debug.xcconfig'))"
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:86:in `require': cannot load such file -- xcodeproj (LoadError)
	from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:86:in `require'
	from -e:1:in `<main>'

Reproduction

Platform and OS info

Apple M1 / macOS 12.7.1 / NativeScript 8.6.1 / Nativescript-vue 2.9.0

What is expected?

I expect "ns build ios" to complete successfully.

What is actually happening?

I'm getting an error.

Note: Since this is a build issue I can't provide a reproduction and since this is a private company repo I can't provide a link to the code. I'm hoping there may be some troubleshooting steps I can take that won't require either of those.

Steps to reproduce

From project directory run ns doctor ios which outputs:

No issues were detected.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 14.2.0 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 8.6.1 version and is up to date.
⚠ Update available for component @nativescript/core. Your current version is 8.4.7 and the latest available version is 8.6.1.
⚠ Update available for component @nativescript/ios. Your current version is 8.4.1 and the latest available version is 8.6.3.

Run ns build ios. Error is returned:

Command failed: ruby -e "require 'xcodeproj';
		userConfig = Xcodeproj::Config.new('/Users/jwhitley/Code/myhighland-app/platforms/ios/plugins-debug.xcconfig')
		existingConfig = Xcodeproj::Config.new('/Users/jwhitley/Code/myhighland-app/App_Resources/iOS/build.xcconfig')
		userConfig.attributes.each do |key,|
  			existingConfig.attributes.delete(key) if (userConfig.attributes.key?(key) && existingConfig.attributes.key?(key))
		end
		userConfig.merge(existingConfig).save_as(Pathname.new('/Users/jwhitley/Code/myhighland-app/platforms/ios/plugins-debug.xcconfig'))"
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:86:in `require': cannot load such file -- xcodeproj (LoadError)
	from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:86:in `require'
	from -e:1:in `<main>'
	

Troubleshooting

I've tried googling different parts of this error, but I'm not discovering any solutions. The only thing I've found that is similar is this post where the user explains that he solved the problem by fixing a "Ruby install conflict". He said he updated Ruby and cocoapods (re-installed) and it "started working".

I thought I'd give it a shot so I ran brew upgrade ruby and only got more confused.

➜  myhighland-app git:(feature/v1.0.10-jarrod) ✗ brew upgrade ruby
==> Downloading https://formulae.brew.sh/api/formula.jws.json
################################################################################################################################# 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
################################################################################################################################# 100.0%
Warning: ruby 3.2.2_1 already installed
➜  myhighland-app git:(feature/v1.0.10-jarrod) ✗ ruby --version
ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin21]

So I'm not even sure what version of Ruby I'm on, but I also re-installed cocoapods successfully and still get the same error. I'm not sure what the next step should be. Any help would be appreciated.

Relevant log output (if applicable)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*                                                                                                                                               *
*  The "TRACE" log level might print some sensitive data like secrets or access tokens in request URLs. Be careful when you share this output.  *
*                                                                                                                                               *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


Trying to get macOS version.
Exec system_profiler SPSoftwareDataType -detailLevel mini
stdout: Software:

    System Software Overview:

      System Version: macOS 12.7.1 (21G920)
      Kernel Version: Darwin 21.6.0
      Time since boot: 4 days 2:56


stderr:
macOS version based on system_profiler is 12.7.
Looking for project in '[[redacted]]'
Project directory is '[[redacted]]'.
Initializing project identifiers. Config:  {
id: '[[redacted]]',
appPath: 'src',
appResourcesPath: 'App_Resources',
android: { v8Flags: '--expose_gc', markingMode: 'none' }
}
Loading extensions.
Collecting system information...
System information:
{
"platform": "darwin",
"shell": "/bin/zsh",
"os": "Darwin [[redacted]].local 21.6.0 Darwin Kernel Version 21.6.0: Wed Oct  4 23:56:02 PDT 2023; root:xnu-8020.240.18.704.15~1/RELEASE_ARM64_T6000 x86_64\n",
"procArch": "x64",
"nodeVer": "16.14.2",
"npmVer": "8.5.0",
"nodeGypVer": null,
"nativeScriptCliVersion": "8.6.1",
"gitVer": "2.37.1 (Apple Git-137.1)",
"dotNetVer": null,
"javacVersion": "11.0.15",
"javaVersion": "11.0.15",
"javaPath": "java",
"adbVer": null,
"androidInstalled": false,
"monoVer": null,
"gradleVer": null,
"isAndroidSdkConfiguredCorrectly": false,
"xcodeVer": "14.2.0",
"xcodeprojLocation": "/opt/homebrew/bin/xcodeproj",
"itunesInstalled": false,
"cocoaPodsVer": "1.14.3",
"isCocoaPodsWorkingCorrectly": true,
"isCocoaPodsUpdateRequired": false,
"pythonInfo": {
"isInstalled": true,
"isSixPackageInstalled": true
}
}
Current CLI version:  8.6.1
Project dir from hooksArgs is: undefined.
Hooks directories: [[[redacted]]]
BeforeHookName for command resolveCommand is before-resolveCommand
Project dir from hooksArgs is: undefined.
AfterHookName for command resolveCommand is after-resolveCommand
Trying to handle SIGINT event. CLI overrides this behavior and does not allow handling SIGINT as this causes issues with Ctrl + C in terminal.
The stackTrace of the location trying to handle SIGINT is (note: this is not an error, just a stack-trace for debugging purposes):
at process.on (/usr/local/lib/node_modules/nativescript/lib/nativescript-cli.js:28:28)
at /usr/local/lib/node_modules/nativescript/node_modules/signal-exit/index.js:158:17
at Array.filter (<anonymous>)
at load (/usr/local/lib/node_modules/nativescript/node_modules/signal-exit/index.js:156:23)
at module.exports (/usr/local/lib/node_modules/nativescript/node_modules/signal-exit/index.js:62:7)
at Object.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/proper-lockfile/lib/lockfile.js:331:1)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
spawn: /usr/local/bin/node "/usr/local/lib/node_modules/nativescript/lib/detached-processes/cleanup-process.js" "/usr/local/lib/node_modules/nativescript/lib/bootstrap.js"
Initializing analytics statuses.
Analytics statuses:  { TrackFeatureUsage: 'enabled', TrackExceptions: 'enabled' }
Will send the following information to Google Analytics: {
type: 'googleAnalyticsData',
category: 'CLI',
googleAnalyticsDataType: 'pageview',
path: 'doctor ios',
title: 'doctor ios',
customDimensions: { cd5: 'CLI', cd2: 'Vue.js', cd9: 'false' }
}
spawn: /usr/local/bin/node "/usr/local/lib/node_modules/nativescript/lib/services/analytics/analytics-broker-process.js" "/usr/local/lib/node_modules/nativescript/lib/bootstrap.js"
Will send the following information to Google Analytics: {
type: 'googleAnalyticsData',
category: 'CLI',
googleAnalyticsDataType: 'event',
action: 'Options',
label: '{"log":"trace","$0":"ns","profileDir":"private","bundle":"webpack"}',
customDimensions: { cd2: 'Vue.js', cd9: 'false', cd5: 'CLI' },
value: undefined
}
⠋ Getting environment information
✔ Getting environment information

No issues were detected.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 14.2.0 satisfies minimum required version 10.
⠴ Getting NativeScript components versions information...Exec npm view nativescript  dist-tags --json
stdout: {
"latest": "8.6.1",
"next": "8.6.2-next-10-24-2023-6620738338",
"beta": "8.6.0-beta.1",
"dev": "8.5.4-dev.1",
"rc": "8.5.0-rc.0",
"vision": "8.6.2-vision.8",
"alpha": "8.6.0-alpha.0",
"embed": "8.6.2-embed.0"
}

stderr:
Using version 8.6.1.
⠧ Getting NativeScript components versions information...Exec npm view tns-core-modules  dist-tags --json
stdout: {
"latest": "6.5.27",
"tns-next": "6.5.25-tns-next-09-28-2021-1283647697"
}

stderr:
Using version 6.5.27.
⠇ Getting NativeScript components versions information...Exec npm view @nativescript/core  dist-tags --json
stdout: {
"latest": "8.6.1",
"next": "8.6.2-next-11-25-2023-6990852765",
"tns": "6.5.27",
"tns-next": "6.5.25-tns-next-09-28-2021-1283647697",
"alpha": "8.5.4-alpha.2",
"sap": "8.1.0-sap.0",
"rc": "8.5.1-rc.3",
"dom": "8.5.0-dom.2",
"nsdom": "8.5.0-nsdom.3",
"beta": "8.6.0-beta.0",
"vision": "8.6.1-vision.9"
}

stderr:
Using version 8.6.1.
⠴ Getting NativeScript components versions information...Exec npm view @nativescript/ios  dist-tags --json
stdout: {
"latest": "8.6.3",
"JSC": "6.5.6",
"alpha": "8.6.0-alpha.1",
"sap": "8.3.0-sap.0",
"dev": "8.5.3-dev.3",
"next": "8.6.4-next.2023-11-08-6801045194"
}

stderr:
Using version 8.6.3.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 8.6.1 version and is up to date.
⚠ Update available for component @nativescript/core. Your current version is 8.4.7 and the latest available version is 8.6.1.
⚠ Update available for component @nativescript/ios. Your current version is 8.4.1 and the latest available version is 8.6.3.
Unable to validate if project has short imports. Error is Error: ENOENT: no such file or directory, scandir '[[redacted]]/node_modules/tns-core-modules'
at Object.readdirSync (node:fs:1392:3)
at FileSystem.readDirectory (/usr/local/lib/node_modules/nativescript/lib/common/file-system.js:210:19)
at DoctorService.getShortImportRegExp (/usr/local/lib/node_modules/nativescript/lib/services/doctor-service.js:189:14)
at DoctorService.getDeprecatedShortImportsInFiles (/usr/local/lib/node_modules/nativescript/lib/services/doctor-service.js:169:40)
at DoctorService.checkForDeprecatedShortImportsInAppDir (/usr/local/lib/node_modules/nativescript/lib/services/doctor-service.js:155:43)
at DoctorService.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/services/doctor-service.js:81:18)
at Generator.next (<anonymous>)
at fulfilled (/usr/local/lib/node_modules/nativescript/lib/services/doctor-service.js:11:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
errno: -2,
syscall: 'scandir',
code: 'ENOENT',
path: '[[redacted]]/node_modules/tns-core-modules'
}
Project dir from hooksArgs is: [[redacted]].
BeforeHookName for command checkEnvironment is before-checkEnvironment
Will send the following information to Google Analytics: {
type: 'googleAnalyticsData',
category: 'CLI',
googleAnalyticsDataType: 'event',
action: 'Check Local Build Setup',
label: 'Starting',
customDimensions: { cd2: 'Vue.js', cd9: 'false', cd5: 'CLI' },
value: undefined
}
getInfos cacheConfig options: { forceCheck: undefined }  current info from cache:  [
{
message: 'Xcode is installed and is configured properly.',
platforms: [ 'iOS' ],
type: 'info'
},
{
message: 'xcodeproj is installed and is configured properly.',
platforms: [ 'iOS' ],
type: 'info'
},
{
message: 'CocoaPods are installed.',
platforms: [ 'iOS' ],
type: 'info'
},
{
message: 'CocoaPods update is not required.',
platforms: [ 'iOS' ],
type: 'info'
},
{
message: 'CocoaPods are configured properly.',
platforms: [ 'iOS' ],
type: 'info'
},
{
message: 'Your current CocoaPods version is newer than 1.0.0.',
platforms: [ 'iOS' ],
type: 'info'
},
{
message: 'Python installed and configured correctly.',
platforms: [ 'iOS' ],
type: 'info'
},
{
message: "The Python 'six' package is found.",
platforms: [ 'iOS' ],
type: 'info'
},
{
message: 'Xcode version 14.2.0 satisfies minimum required version 10.',
platforms: [ 'iOS' ],
type: 'info'
}
]
Xcode is installed and is configured properly.
xcodeproj is installed and is configured properly.
CocoaPods are installed.
CocoaPods update is not required.
CocoaPods are configured properly.
Your current CocoaPods version is newer than 1.0.0.
Python installed and configured correctly.
The Python 'six' package is found.
Xcode version 14.2.0 satisfies minimum required version 10.
Will send the following information to Google Analytics: {
type: 'googleAnalyticsData',
category: 'CLI',
googleAnalyticsDataType: 'event',
action: 'Check Local Build Setup',
label: 'Finished: Is setup correct: true',
customDimensions: { cd2: 'Vue.js', cd9: 'false', cd5: 'CLI' },
value: undefined
}
Project dir from hooksArgs is: [[redacted]].
AfterHookName for command checkEnvironment is after-checkEnvironment

Environment

OS: macOS 12.7.1
CPU: (10) x64 Apple M1 Pro
Shell: /bin/zsh
node: 16.14.2
npm: 8.5.0
nativescript: 8.6.1

# android
java: 11.0.15
ndk: Not Found
apis: Not Found
build_tools: Not Found
system_images: Not Found

# ios
xcode: 14.2/14C18
cocoapods: 1.14.3
python: Not Found
python3: 3.11.6
ruby: 2.6.10
platforms:
  - DriverKit 22.2
  - iOS 16.2
  - macOS 13.1
  - tvOS 16.1
  - watchOS 9.1

Dependencies

"dependencies": {
  "@nativescript/apple-sign-in": "^1.0.0",
  "@nativescript/background-http": "^6.0.0",
  "@nativescript/core": "8.4",
  "@nativescript/facebook": "~2.1.0",
  "@nativescript/firebase-analytics": "https://gitpkg.now.sh/meganedesigns/firebase/packages/firebase-analytics?2.0.1b",
  "@nativescript/firebase-core": "https://gitpkg.now.sh/meganedesigns/firebase/packages/firebase-core?2.0.1b",
  "@nativescript/firebase-messaging": "https://gitpkg.now.sh/meganedesigns/firebase/packages/firebase-messaging?2.0.1b",
  "@nativescript/google-signin": "^1.0.0",
  "@nativescript/imagepicker": "^1.0.6",
  "@nativescript/local-notifications": "^6.0.0",
  "@nativescript/theme": "~3.0.1",
  "@triniwiz/nativescript-socketio": "^4.0.1",
  "@triniwiz/nativescript-toasty": "^4.1.3",
  "assert": "^2.0.0",
  "axios": "^0.24.0",
  "browserify-zlib": "^0.2.0",
  "buffer": "^6.0.3",
  "facebookgraph": "^0.4.0",
  "highlight-words-core": "^1.2.2",
  "https-browserify": "^1.0.0",
  "nativescript-appversion": "github:imandyie/nativescript-appversion",
  "nativescript-fonticon": "^2.0.2",
  "nativescript-gif": "^5.0.0",
  "nativescript-phone": "^3.0.2",
  "nativescript-ui-listview": "^10.0.2",
  "nativescript-vue": "~2.9.0",
  "nativescript-vue-template-compiler": "~2.9.0",
  "os-browserify": "^0.3.0",
  "path": "^0.12.7",
  "platform": "^1.3.6",
  "rxjs": "^7.5.5",
  "sass": "^1.32.8",
  "stream-browserify": "^3.0.0",
  "stream-http": "^3.2.0",
  "tty-browserify": "0.0.1",
  "url": "^0.11.0",
  "util": "^0.12.4",
  "v-mask": "^2.3.0",
  "vue-axios": "^3.4.0",
  "vuex": "^3.6.2"
},
"devDependencies": {
  "@nativescript/android": "8.4",
  "@nativescript/ios": "8.4",
  "@nativescript/webpack": "~5.0.0",
  "@vue/devtools": "^5.3.4",
  "nativescript-vue-devtools": "^1.5.1"
}

Please accept these terms

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-pending-triageReported bug, pending triage to confirm.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions