简体   繁体   English

Ruby on Rails-如何在Windows中安装水豚宝石?

[英]Ruby on Rails - how to install capybara gem in Windows?

Please help me to install capybara gem in Windows. 请帮助我在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. 我已经按照同事的建议下载并安装了约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

I've ran capybara tests on a windows xp machine before. 我之前在Windows XP机器上进行过水豚测试。 You probably need the devkit: http://rubyinstaller.org/downloads/ 您可能需要devkit: http: //rubyinstaller.org/downloads/

相反,最好与RailsInstaller一起使用,这将使您避免尝试除RubyInstaller本身以外的其他依赖项时遇到的许多陷阱。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM