I just started learning how to write my own Cocoapod yesterday. There’s a great tutorial to get you started. However, I ran into an issue when trying to lint my new spec. It looked like this:
$ pod spec lint MyAwesomeLibrary.podspec
<p>-> MyAwesomeLibrary (0.0.1)<br />
- ERROR | [iOS] [xcodebuild] 2013-05-29 23:03:08.370 xcodebuild[91499:3f03] error: Error Domain=NSPOSIXErrorDomain Code=2 "Non-zero exit code 255 returned from shell command: /usr/bin/gcc-4.2 -v -E -dM -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -x objective-c -c /dev/null 2>&1" UserInfo=0x4001c4e60 {NSLocalizedDescription=Non-zero exit code 255 returned from shell command: /usr/bin/gcc-4.2 -v -E -dM -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -x objective-c -c /dev/null 2>&1, NSLocalizedFailureReason=No such file or directory}<br />
- ERROR | [iOS] [xcodebuild] 2013-05-29 23:03:08.457 xcodebuild[91499:3f03] error: Error Domain=NSPOSIXErrorDomain Code=2 "Non-zero exit code 1 returned from shell command: /usr/bin/gcc-4.2 -v -E -dM -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -x objective-c -c /dev/null 2>&1" UserInfo=0x4018946a0 {NSLocalizedDescription=Non-zero exit code 1 returned from shell command: /usr/bin/gcc-4.2 -v -E -dM -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -x objective-c -c /dev/null 2>&1, NSLocalizedFailureReason=No such file or directory}</p>
<p>Analyzed 1 podspec.</p>
<p>[!] The spec did not pass validation.
When I manually ran the command in the above error message, I saw this error:
$ /usr/bin/gcc-4.2 -v -E -dM -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -x objective-c -c /dev/null 2>&1<br />
gcc-4.2: error trying to exec '/usr/bin/arm-apple-darwin11-gcc-4.2.1': execvp: No such file or directory
I don’t have the file “/usr/bin/arm-apple-darwin11-gcc-4.2.1”. If you see this too, you should check whether you have a preferred C Compiler. This is configured via the CC environment variable. Mine was set to gcc-4.2.
$ echo $CC<br />
gcc-4.2
To let cocoapods use the default compiler instead, just run the linter as
$ CC= pod spec lint MyAwesomeLibrary.podspec</p>
<p>-> MyAwesomeLibrary (0.0.1)</p>
<p>Analyzed 1 podspec.</p>
<p>MyAwesomeLibrary.podspec passed validation.
Woohoo! It passed!
1 comment
Imported from the previous site.
sara· February 13, 2014
Thank You!!