rubygems - Issues with installing ffi gem on OS X yosemite with ruby-2.2.2 -


i'm trying install ffi gem can use guard-rspec using command sudo gem install ffi -v '1.9.8'. end getting output:

building native extensions.  take while... error:  error installing ffi:     error: failed build gem native extension.      /usr/local/bin/ruby -r ./siteconf20150424-14771-zza3du.rb extconf.rb *** extconf.rb failed *** not create makefile due reason, lack of necessary libraries and/or headers.  check mkmf.log file more details.  may need configuration options.  provided configuration options:     --with-opt-dir     --without-opt-dir     --with-opt-include     --without-opt-include=${opt-dir}/include     --with-opt-lib     --without-opt-lib=${opt-dir}/lib     --with-make-prog     --without-make-prog     --srcdir=.     --curdir     --ruby=/usr/local/bin/$(ruby_base_name)     --with-ffi_c-dir     --without-ffi_c-dir     --with-ffi_c-include     --without-ffi_c-include=${ffi_c-dir}/include     --with-ffi_c-lib     --without-ffi_c-lib=${ffi_c-dir}/lib     --with-libffi-config     --without-libffi-config     --with-pkg-config     --without-pkg-config /usr/local/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': compiler failed generate executable file. (runtimeerror) have install development tools first.     /usr/local/lib/ruby/2.2.0/mkmf.rb:541:in `try_link0'     /usr/local/lib/ruby/2.2.0/mkmf.rb:556:in `try_link'     /usr/local/lib/ruby/2.2.0/mkmf.rb:637:in `try_ldflags'     /usr/local/lib/ruby/2.2.0/mkmf.rb:1780:in `pkg_config'     extconf.rb:15:in `<main>'  extconf failed, exit code 1  gem files remain installed in /usr/local/lib/ruby/gems/2.2.0/gems/ffi-1.9.8 inspection. results logged /usr/local/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/ffi-1.9.8/gem_make.out 

the mkmf.log file looks this:

"/usr/local/bin/gcc -o conftest -i/usr/local/include/ruby-2.2.0/x86_64-darwin14 -i/usr/local/include/ruby-2.2.0/ruby/backward -i/usr/local/include/ruby-2.2.0 -i. -d_xopen_source -d_darwin_c_source -d_darwin_unlimited_select -d_reentrant    -o3 -fno-fast-math -ggdb3 -wall -wextra -wno-unused-parameter -wno-parentheses -wno-long-long -wno-missing-field-initializers -wunused-variable -wpointer-arith -wwrite-strings -wdeclaration-after-statement -wimplicit-function-declaration -wdeprecated-declarations -wno-packed-bitfield-compat  -pipe conftest.c  -l. -l/usr/local/lib -l. -fstack-protector     -lruby-static -framework corefoundation  -lpthread -lgmp -ldl -lobjc " sh: line 1: 14464 trace/bpt trap: 5       /applications/xcode.app/contents/developer/usr/bin/xcodebuild -sdk / -find dsymutil 2> /dev/null dsymutil: error: unable find utility "dsymutil", not developer tool or in path collect2: error: dsymutil returned 72 exit status checked program was: /* begin */ 1: #include "ruby.h" 2:  3: int main(int argc, char **argv) 4: { 5:   return 0; 6: } /* end */ 

so mkmf.rb seems complaining can't find dsymutil. command /applications/xcode.app/contents/developer/usr/bin/xcodebuild -sdk / -find dsymutil gives output

/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/dsymutil

so problem isn't don't have command line tools installed.

i decided take @ source code mkmf.rb see if figure out going on. method raised error is:

  def try_do(src, command, *opts, &b)       unless have_devel?         raise <<msg compiler failed generate executable file. have install development tools first. msg       end       begin         src = create_tmpsrc(src, &b)         xsystem(command, *opts)       ensure         log_src(src)         makemakefile.rm_rf "#{conftest}.dsym"       end     end 

so can see error gets raised raised if method have_devel? returns false. check out:

$ irb irb(main):001:0> require 'mkmf' => true irb(main):002:0> have_devel? => true 

great. ruby can find command line tools. if run irb root:

$ sudo irb password: irb(main):001:0> require 'mkmf' => true irb(main):002:0> have_devel? => false 

it fails. mkmf.log file gets spit out same 1 above, complaining lack of dsymutil. have no idea why happen.

does have suggestions how ffi installed? suspect weird box , nobody able reproduce mkmf behavior.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -