ruby의 ffi 모듈을 설치하다가 컴파일 에러가 발생했다. 


$ sudo gem install ffi -v '1.9.10'

 

/Users/Samuel/.rbenv/versions/2.1.0/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)

You have to install development tools first.

from /Users/Samuel/.rbenv/versions/2.1.0/lib/ruby/2.1.0/mkmf.rb:587:in `try_cpp'

from /Users/Samuel/.rbenv/versions/2.1.0/lib/ruby/2.1.0/mkmf.rb:1067:in `block in have_header'

from /Users/Samuel/.rbenv/versions/2.1.0/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'

from /Users/Samuel/.rbenv/versions/2.1.0/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'

from /Users/Samuel/.rbenv/versions/2.1.0/lib/ruby/2.1.0/mkmf.rb:321:in `open'

from /Users/Samuel/.rbenv/versions/2.1.0/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'

from /Users/Samuel/.rbenv/versions/2.1.0/lib/ruby/2.1.0/mkmf.rb:321:in `open'

from /Users/Samuel/.rbenv/versions/2.1.0/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'

from /Users/Samuel/.rbenv/versions/2.1.0/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'

from /Users/Samuel/.rbenv/versions/2.1.0/lib/ruby/2.1.0/mkmf.rb:1066:in `have_header'

from extconf.rb:16:in `<main>'


extconf failed, exit code 1



xcode 개발자 툴 설치는 간단히 xcode-select 커맨드로 해결할 수 있다. 


$ xcode-select --install

 // xcode 개발툴 설치




$ sudo gem install ffi -v '1.9.10'

Building native extensions.  This could take a while...

Successfully installed ffi-1.9.10

Parsing documentation for ffi-1.9.10

Installing ri documentation for ffi-1.9.10

Done installing documentation for ffi after 0 seconds

1 gem installed



Posted by '김용환'
,