安装hitimes gem作为Rails包的一部分时出错

时间:2014-09-20 20:50:56

标签: ruby-on-rails ruby xcode macos

我正在尝试安装适用于我的2009 iMac和2012 MacBook Pro的Rails套件,但不适用于我朋友的2011款MacBook Pro。所有这些系统都在运行Mavericks并安装了Xcode和最新的Command Line Tools(一遍又一遍地验证)。安装hitimes和nokogiri时Bundler出错; hitimes错误在这里:

Installing hitimes (1.2.2) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/Users/name/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb 
creating Makefile

make "DESTDIR="
compiling hitimes.c
compiling hitimes_instant_clock_gettime.c
compiling hitimes_instant_osx.c
compiling hitimes_instant_windows.c
compiling hitimes_interval.c
compiling hitimes_stats.c
linking shared-object hitimes/2.0/hitimes.bundle
ld: warning: directory not found for option '-L/Users/mpapis/.sm/pkg/active/lib'
ld: framework not found CoreServices
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [hitimes.bundle] Error 1

Gem files will remain installed in /Users/name/.rvm/gems/ruby-2.0.0-p247/gems/hitimes-1.2.2 for inspection.
Results logged to /Users/name/.rvm/gems/ruby-2.0.0-p247/gems/hitimes-1.2.2/ext/hitimes/c/gem_make.out

An error occurred while installing hitimes (1.2.2), and Bundler cannot continue.
Make sure that gem install hitimes -v '1.2.2' succeeds before bundling.

当我们尝试时,按照它的建议," gem install hitimes -v' 1.2.2'",我们得到:

Building native extensions. This could take a while...
ERROR: Error installing hitimes:
ERROR: Failed to build gem native extension.

/Users/name/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
creating Makefile

make "DESTDIR="
compiling hitimes.c
compiling hitimes_instant_clock_gettime.c
compiling hitimes_instant_osx.c
compiling hitimes_instant_windows.c
compiling hitimes_interval.c
compiling hitimes_stats.c
linking shared-object hitimes/2.0/hitimes.bundle
ld: warning: directory not found for option '-L/Users/mpapis/.sm/pkg/active/lib'
ld: framework not found CoreServices
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [hitimes.bundle] Error 1

对我来说,这看起来我们仍然没有安装Xcode或命令行工具。但是,我们重新安装了这两个。可能是什么问题?

我看过类似问题的帖子,但没有一个包含解决方案。请参阅herehere

1 个答案:

答案 0 :(得分:0)

当我们升级到Ruby 2.1.1时,这个问题就解决了。