首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法安装posix-spawn

无法安装posix-spawn
EN

Stack Overflow用户
提问于 2013-04-25 02:00:51
回答 2查看 1.6K关注 0票数 0

我通过Xcode > Preferences > Downloads > Components > Command Line Tools安装了Xcode4.6.2命令行工具,它的状态是“已安装”,但是在MacOS10.8.3上重启我的mac后,我没有/Developer文件夹,当我尝试运行sudo gem install posix-spawn时,我得到了这个错误:

代码语言:javascript
复制
Building native extensions.  This could take a while...
ERROR:  Error installing posix-spawn:
    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. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common  -Wall   -c posix-spawn.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 posix_spawn_ext.bundle posix-spawn.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: 'posix-spawn.o'
make: *** [posix_spawn_ext.bundle] Error 1


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/posix-spawn-0.3.6 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/posix-spawn-0.3.6/ext/gem_make.out

other questions建议安装Xcode命令行工具,但我已经这样做了。/usr/bin/gcc-4.2存在。

EN

回答 2

Stack Overflow用户

发布于 2013-04-25 02:51:17

解决方案是先运行sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/,然后运行sudo gem install posix-spawn

票数 0
EN

Stack Overflow用户

发布于 2021-12-23 07:54:17

重新安装Xcode对我来说很有效。运行xcode-select --install,然后使用gem install posix-spawn安装gem。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16199070

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档