Ruby
Xcode
Yosemite

Macでbundle installしようとしたら、hitimesでエラー

More than 3 years have passed since last update.

bundle install中にhitimesで下記エラー発生。

$ bundle install --path vendor/bundle --binstubs

Fetching gem metadata from https://rubygems.org/........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/Users/hogehoge/.rbenv/versions/2.1.2/bin/ruby extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling hitimes.c
couldn't understand kern.osversion `14.0.0'
In file included from /Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/ruby.h:29,
from /Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby.h:33,
from hitimes.c:1:
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/defines.h:26:19: error: stdio.h: No such file or directory
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/defines.h:28:24: error: sys/types.h: No such file or directory
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/defines.h:31:23: error: sys/stat.h: No such file or directory
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/defines.h:34:21: error: stdlib.h: No such file or directory
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/defines.h:45:21: error: string.h: No such file or directory
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/defines.h:48:22: error: strings.h: No such file or directory
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/defines.h:51:23: error: inttypes.h: No such file or directory
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/defines.h:54:21: error: stdint.h: No such file or directory
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/defines.h:57:21: error: unistd.h: No such file or directory
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/defines.h:61:25: error: sys/select.h: No such file or directory
In file included from /Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/defines.h:68,
from /Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/ruby.h:29,
from /Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby.h:33,
from hitimes.c:1:
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/missing.h:23:45: error: math.h: No such file or directory
In file included from /Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/ruby.h:184,
from /Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby.h:33,
from hitimes.c:1:
/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h:10:25: error: limits.h: No such file or directory
In file included from /Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:35,
from /Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/ruby.h:1694,
from /Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby.h:33,
from hitimes.c:1:
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/st.h:139: error: expected declaration specifiers or ‘...’ before ‘uint32_t’
In file included from /Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/ruby.h:1694,
from /Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby.h:33,
from hitimes.c:1:
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:348: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fdset_t’
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:440: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:440: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:440: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:440: warning: ‘struct timeval’ declared inside parameter list
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:440: warning: its scope is only this definition or declaration, which is probably not what you want
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:441: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:441: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:441: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:441: warning: ‘struct timeval’ declared inside parameter list
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:442: warning: ‘struct timeval’ declared inside parameter list
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:545: error: expected declaration specifiers or ‘...’ before ‘mode_t’
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:624: error: expected declaration specifiers or ‘...’ before ‘pid_t’
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:638: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fork’
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:639: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fork_err’
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:641: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_waitpid’
/Users/hogehoge/.rbenv/versions/2.1.2/bin/ruby extconf.rb
creating Makefile
/Users/hogehoge/.rbenv/versions/2.1.2/bin/ruby extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling hitimes.c
couldn't understand kern.osversion `14.0.0'
In file included from /Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/ruby.h:29,
from /Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby.h:33,
from hitimes.c:1:
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/defines.h:26:19: error: stdio.h: No such file or directory
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/defines.h:28:24: error: sys/types.h: No such file or directory
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/defines.h:31:23: error: sys/stat.h: No such file or directory
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/defines.h:34:21: error: stdlib.h: No such file or directory
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:642: error: expected ‘)’ before ‘pid’
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:643: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_spawn’
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:644: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_spawn_err’
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:646: error: expected ‘)’ before ‘pid’
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:755: error: expected declaration specifiers or ‘...’ before ‘uint32_t’
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:882: error: expected ‘)’ before ‘long’
/Users/hogehoge/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/intern.h:883: error: expected ‘)’ before ‘long’
In file included from hitimes.c:2:
hitimes_interval.h:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hitimes_instant_t’
hitimes_interval.h:35: error: expected specifier-qualifier-list before ‘hitimes_instant_t’
hitimes_interval.h:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hitimes_get_current_instant’
make: *** [hitimes.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/hogehoge/chef-repo/vendor/bundle/ruby/2.1.0/gems/hitimes-1.2.2 for inspection.
Results logged to /Users/hogehoge/chef-repo/vendor/bundle/ruby/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/hitimes-1.2.2/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.

下記、コメンドで解決。

$ xcode-select --install

xcode-select: note: install requested for command line developer tools