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

标签 gem bundle autotest fsevents xcode4.3

更新到 Xcode 4.3(删除了旧版本的 Xcode)后,我一直无法安装 autotest-fsevent gem。命令行工具是通过首选项 > 下载 > 组件选项卡安装的。

osx 10.7.3、rvm 1.10.2、ruby 1.9.3-rc1、 bundler 1.0.22

$ 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.

README 只是表明需要 Xcode。

我似乎选择了正确的 Xcode.app:
$ xcode-select -print-path
/Applications/Xcode.app/Contents/Developer

还有其他人有这个问题吗?任何想法如何解决这个问题?

最佳答案

事实证明,Xcode 路径是硬编码在 gem 文件中的:
ext/fsevent/extconf.rb:

...
  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")
...
Xcode 4.3 现在作为应用程序安装在/Applications 中。另一个 github 用户( fxposter )发现了同样的问题并发出了 pull request比我早几个小时。提议的更改已合并到 gem 和 v0.2.8 中已被释放。

关于gem - 无法使用 Xcode 4.3 安装 autotest-fsevent gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9365085/

相关文章:

ruby-on-rails - 无法在任何存储库中找到有效的 gem 'rails' (>= 0)

java - 当我使用浏览器运行自动测试时出错。怎么运行呢?

ruby-on-rails - Ruby:使用 Gems 处理重复性日历事件的经验?

ruby-on-rails - Ruby on Rails 图形 gem ?

ruby - SimpleCov 0% 覆盖率

css - 设计在 Rails 4.2 网站上无法正常工作

angular - webpack- Angular : bundle includes entire node_modules of library

java - strip 化不同 JAR 中的资源包

java - Selenium 中的通用字段初始化

html - 如何使用 XPath 在 HTML 中搜索标题?