2

在这个命令之后,sudo gem install cocoapods我得到了下面的错误。

我认为它连接到了 Xcode 5 的错误路径。当我安装它时,我将它保存在桌面上,但他们将它移到了应用程序文件夹中。我使用 Xcode 4.6.3 和 Xcode 5。如何更改路径来解决此问题。命令行工具安装在两个 XCode 上。

Building native extensions.  This could take a while...
ERROR:  Error installing cocoapods:
    ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
creating Makefile

make
xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -DJSON_GENERATOR  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386 -arch x86_64 -g -O3 -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common   -c generator.c
xcrun: Error: could not stat active Xcode path '/Users/alex/Desktop/Xcode 5.app/Contents/Developer'. (No such file or directory)
cc -arch i386 -arch x86_64 -pipe -bundle -undefined dynamic_lookup -o generator.bundle generator.o -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64     -lruby  -lpthread -ldl -lobjc  
clang: error: no such file or directory: 'generator.o'
make: *** [generator.bundle] Error 1


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.8.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
4

1 回答 1

6

我已经在终端中运行了这个命令

sudo xcode-select -switch /Applications/Xcode.app

这个对我有用

于 2013-09-21T09:26:36.117 回答