1

Please help me to install capybara gem in Windows.

>gem install capybara
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing capybara:
        ERROR: Failed to build gem native extension.

        C:/Ruby193/bin/ruby.exe extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for rb_thread_blocking_region()... yes
checking for ruby_native_thread_p()... yes
checking for rb_thread_call_with_gvl()... yes
creating extconf.h
creating Makefile

make
generating ffi_c-i386-mingw32.def
Configuring libffi
configure: WARNING: cache variable lt_cv_path_LD contains a newline
configure: WARNING: cache variable lt_cv_path_LD contains a newline
make -C "/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/libffi-i386-mingw32"
make[1]: Entering directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/libffi-i386-mingw32'
Makefile:318: *** missing separator.  Stop.
make[1]: Leaving directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/libffi-i386-mingw32'
make: *** ["/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/libffi-i386-mingw32"/.libs/libffi_convenience.a] Error 2


Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/gem_make.out

I already have downloaded and installed some 1,7 GB "QT" thing as my colleagues advised, with no effect.

Update:

>gem install ffi
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing ffi:
        ERROR: Failed to build gem native extension.

        C:/Ruby193/bin/ruby.exe extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for rb_thread_blocking_region()... yes
checking for ruby_native_thread_p()... yes
checking for rb_thread_call_with_gvl()... yes
creating extconf.h
creating Makefile

make
generating ffi_c-i386-mingw32.def
Configuring libffi
configure: WARNING: cache variable lt_cv_path_LD contains a newline
configure: WARNING: cache variable lt_cv_path_LD contains a newline
make -C "/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/libffi-i386-mingw32"
make[1]: Entering directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/libffi-i386-min
gw32'
Makefile:318: *** missing separator.  Stop.
make[1]: Leaving directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/libffi-i386-ming
w32'
make: *** ["/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/libffi-i386-mingw32"/.libs/libff
i_convenience.a] Error 2


Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.1.5/ext/ffi_c/gem_make.out
Paul
  • 25,812
  • 38
  • 124
  • 247

2 Answers2

1

I've ran capybara tests on a windows xp machine before. You probably need the devkit: http://rubyinstaller.org/downloads/

agmcleod
  • 13,321
  • 13
  • 57
  • 96
  • Hrmm. What happens when you try to install ffi? `gem install ffi` – agmcleod Sep 06 '12 at 14:06
  • Yeah it looked like that was failing, just wanted to be sure. Doing a quick search, i guess you can try specific versioning as suggested here: http://stackoverflow.com/questions/7852566/error-error-installing-ffi-error-failed-to-build-gem-native-extension – agmcleod Sep 06 '12 at 14:15
  • I have installed ffi -v 1.0.9 and it worked! If you write this as an answer, I'll mark it as accepted. Thank you. – Paul Sep 06 '12 at 14:18
  • You're welcome, I'm glad that worked. Hard to help figure this out when my only PC is at home :) – agmcleod Sep 06 '12 at 14:18
0

It is probably better to work with the RailsInstaller instead, it will save you from a lot of pitfalls trying to sort out dependencies other than the RubyInstaller itself.

prusswan
  • 6,853
  • 4
  • 40
  • 61