我运行sudo gem install localtunnel并得到以下输出。现在我使用homebrew来安装rbenv来安装ruby,当我运行brew doctor时,它显示xcode已过期,但当我打开xcode并转到关于它是最新版本时,下面是我的sudo gem install localtunnel的错误输出
ERROR: Error installing localtunnel:
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 '/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
i686-apple-darwin11-llvm-gcc-4.2: generator.o: No such file or directory
i686-apple-darwin11-llvm-gcc-4.2: generator.o: No such file or directory
lipo: can't figure out the architecture type of: /var/tmp//ccfplODR.out
make: *** [generator.bundle] Error 1发布于 2013-02-19 18:23:23
Xcode4不再安装在/Developer中,但是xcrun似乎希望在那里安装它。
我会先安装“命令行工具”(Xcode偏好设置->下载->组件)。
如果还不能解决问题,请调用
sudo xcode-select -switch /Applications/Xcode.app显式设置xcrun的路径。
发布于 2013-02-21 09:43:17
我的Ruby版本已经过期了,我必须运行rbenv install 1.9.3-p0,然后将其设置为全局。
https://stackoverflow.com/questions/14952809
复制相似问题