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
'Ruby' 카테고리의 다른 글
[ruby] Errno::EACCES: Permission denied (0) | 2016.01.13 |
---|---|
[ruby] gem install 시 openssl 설치시 file not found 해결하기 (0) | 2015.12.22 |
[ruby] csv 처리 (0) | 2015.12.10 |
[ruby] rescue (0) | 2015.12.10 |
[ruby] 특정 단어로 분리(split)된 배열 만들기 (0) | 2015.12.10 |