首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用Xcode 4.3安装autotest-fsevent gem

无法使用Xcode 4.3安装autotest-fsevent gem
EN

Stack Overflow用户
提问于 2012-02-21 00:56:56
回答 1查看 1.8K关注 0票数 4

在更新到Xcode 4.3 (删除了旧版本的Xcode)后,我无法安装autotest-fsevent gem。命令行工具是通过Preferences > Downloads > Components选项卡安装的。

osx 10.7.3、rvm 1.10.2、ruby 1.9.3-rc1、捆绑包1.0.22

代码语言:javascript
复制
$ bundle

Installing autotest-fsevent (0.2.7) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/doc/.rvm/rubies/ruby-1.9.3-rc1/bin/ruby extconf.rb 
extconf.rb:36:in `<main>': Xcode not found - see README for assistance (RuntimeError)


Gem files will remain installed in /Users/doc/.rvm/gems/ruby-1.9.3-rc1@global/gems/autotest-fsevent-0.2.7 for inspection.
Results logged to /Users/doc/.rvm/gems/ruby-1.9.3-rc1@global/gems/autotest-fsevent-0.2.7/ext/fsevent/gem_make.out
An error occured while installing autotest-fsevent (0.2.7), and Bundler cannot continue.
Make sure that `gem install autotest-fsevent -v '0.2.7'` succeeds before bundling.

自述文件简单地指出Xcode是必需的。

我似乎选择了正确的Xcode.app:

代码语言:javascript
复制
$ xcode-select -print-path
/Applications/Xcode.app/Contents/Developer

还有人有这个问题吗?有什么办法解决这个问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-02-21 22:41:03

事实证明,Xcode路径在gem文件中是硬编码的:

ext/fsevent/extconf.rb:

代码语言:javascript
复制
...
  elsif File.exists?('/Developer/Applications/Xcode.app')
    `CFLAGS='-isysroot /Developer/SDKs/MacOSX#{SDK_VERSION}.sdk -mmacosx-version-min=#{SDK_VERSION}' /usr/bin/gcc -framework CoreServices -o "#{GEM_ROOT}/bin/fsevent_sleep" fsevent_sleep.c`
    raise "\e[1;31mCompilation of fsevent_sleep binary failed - see README for assistance\e[0m" unless File.executable?("#{GEM_ROOT}/bin/fsevent_sleep")
...

Xcode4.3现在作为应用程序安装在/Applications中。另一位github用户(fxposter)发现了同样的问题,并在我之前的几个小时发出了一个pull request。建议的更改已经合并到gem中,并且v0.2.8已经发布。

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

https://stackoverflow.com/questions/9365085

复制
相关文章

相似问题

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