0

I am pretty sure this problem started only since I upgraded OS to El-Capitan. Tried running

sudo gem install -n /usr/local/bin compass

And I am getting the error

    ERROR:  Error installing compass:
    ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r     ./siteconf20160413-36157-1bn6ytd.rb extconf.rb
    checking for ffi.h...   /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `block in try_compile'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:502:in `with_werror'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `try_compile'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:1038:in `block in have_header'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:889:in `block in checking_for'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in `open'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in `open'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:888:in `checking_for'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:1037:in `have_header'
    from extconf.rb:16:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.6 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-15/2.0.0/ffi-1.9.6/gem_make.out

Xcode is already installed so I have no idea what the problem is. Any help would be appreciated. Thanks!

mila
  • 471
  • 8
  • 20
  • I know nothing about Ruby, however the error message "checking for ffi.h..." would imply there needs to be a development environment installed on the machine (including headers and libraries). Is that the case? EDIT: Oh and this message, of course: "You have to install development tools first.". – trojanfoe Apr 13 '16 at 08:28
  • @trojanfoe Xcode is the development tool and it's installed already – mila Apr 13 '16 at 08:40
  • Including the command line tools? Were they updated when you updated OSX? – trojanfoe Apr 13 '16 at 08:41
  • @trojanfoe ➜ testyo xcode-select --install xcode-select: error: command line tools are already installed, use "Software Update" to install updates – mila Apr 13 '16 at 08:50
  • [This](http://stackoverflow.com/questions/19688424/why-is-apt-get-function-not-working-in-terminal-on-mac-osx-10-9) post solved my problem, along with updating the OS. – mila Apr 13 '16 at 12:01
  • What? It's about `apt-get`. – trojanfoe Apr 13 '16 at 12:13
  • I had to take a few steps and I'm not sure if the apt-get was redundant. First I had to so Xcode software update (this might have been the solution). Then apt-get install ruby-dev (which was not working for me so I used the url from the comment above. Then I ran sudo gem install -n /usr/local/bin compass and it went smoothly. – mila Apr 17 '16 at 10:04

0 Answers0