【问题标题】:Unable to install posix-spawn无法安装 posix-spawn
【发布时间】:2013-04-18 10:07:45
【问题描述】:

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

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 存在。

【问题讨论】:

标签: ruby xcode gem


【解决方案1】:

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

【讨论】:

    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-05
      • 1970-01-01
      • 2017-08-28
      • 2013-09-04
      • 2019-10-19
      • 2011-01-12
      • 1970-01-01
      • 2020-03-05
      相关资源
      最近更新 更多