Ruby on Rails - 如何在Windows中安装capybara gem?

时间:2022-09-19 09:00:26

Please help me to install capybara gem in Windows.

请帮我在Windows中安装capybara gem。

>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.

我的同事建议我已经下载并安装了大约1,7 GB“QT”的东西,没有任何效果。

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

2 个解决方案

#1


1  

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

我以前在windows xp机器上运行了水豚测试。您可能需要devkit:http://rubyinstaller.org/downloads/

#2


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.

相反,使用RailsInstaller可能会更好,它可以避免许多陷阱,试图解决除RubyInstaller本身之外的依赖关系。

#1


1  

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

我以前在windows xp机器上运行了水豚测试。您可能需要devkit:http://rubyinstaller.org/downloads/

#2


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.

相反,使用RailsInstaller可能会更好,它可以避免许多陷阱,试图解决除RubyInstaller本身之外的依赖关系。