Capybara-webkit (0.8.0) failed to build on window 7

I am newbie. I am trying to create capybara-webkit (0.8.0) with native extensions in window 7. I already installed (a set of paths): RubyMine, Ruby SDK and Gems, Rails, DevKit, Qt, gmake, g ++. But I still have msg error message. Any help is appreciated.

$ gem install capybara-webkit -v '0.8.0' Temporarily strengthening PATH to enable DevKit ... Creating custom extensions. This may take some time ... ERROR: Error installing capybara-webkit: ERROR: Failed to create native gem extension.

c:/Ruby193/bin/ruby.exe extconf.rb 

C: \ Qt \ 4.8.2 \ Bin \ qmake.EXE C: \ make \ gmake.EXE cd src / & & c: /Qt/4.8.2/bin/qmake.exe c: / Ruby193 / lib / ruby ​​/ gems / 1.9.1 / gems / capybara-webkit-0.8.0 / src / webkit_server.pro -spec c: /Qt/4.8.2/mkspecs/macx-g++ -o Makef \ ile.webkit_server C: \ do \ gmake .EXE cd src / & & gmake -f Makefile.webkit_server gmake [1]: Enter the directory `c: /Ruby193/lib/ruby/gems/1.9.1/gems/capybara-webkit-0.8.0/src 'g ++ - c -pipe -g -Wall -W -DQT_WEBKIT_LIB -DQT_GUS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -Ic: /Qt/4.8.2/mkspecs/macx-g++ -I. -Ic: /Qt/4.8.2/include/QtCore -Ic: /Qt/4.8.2/include/QtNetwork -Ic: /Qt/4.8.2/include/QtGui -Ic: /Qt/4.8.2/include / QtWebKit -Ic: /Qt/4.8.2/include -I. -o RequestedUrl.o RequestedUrl.cpp process_begin: CreateProcess ((zero), r ++ -c -g -pipe -Wall -W -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -ic: /Qt/4.8.2/mkspecs/macx -g ++ -I. -Ic: /Qt/4.8.2/include/QtCore -Ic: /Qt/4.8.2/include/QtNetwork -Ic: /Qt/4.8.2 / include / QtGui -Ic: /Qt/4.8.2/include/QtWebKit -Ic: /Qt/4.8.2/include -I. -o RequestedUrl.o Req uestedUrl.cpp, ...). make (e = 2): the system cannot find the specified file.

gmake [1]: * [RequestedUrl.o] Error 2 gmake [1]: leave the directory c:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-webkit-0.8.0/src' c:/Ruby193/lib/ruby/1.9.1/fileutils.rb:1515:in stat ': no ​​such file or directory - src / webkit_server (Errno :: ENOENT) from c: /Ruby193/lib/ruby/1.9.1/fileutils .rb: 1515: in block in fu_each_src_dest' from c:/Ruby193/lib/ruby/1.9.1/fileutils.rb:1529:in fu_each_src_dest0' from c: /Ruby193/lib/ruby/1.9.1/fileutils.rb : 1513: in fu_each_src_dest' from c:/Ruby193/lib/ruby/1.9.1/fileutils.rb:395:in cp' from c: /Ruby193/lib/ruby/gems/1.9.1/gems/capybara-webkit -0.8.0 / lib / capybara_webkit_builder.rb: 33: in build' from c:/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-webkit-0.8.0/lib/capybara_webkit_builder.rb:39:in build_all 'from extconf.rb: 2: in ``

Gem files will remain installed in c: /Ruby193/lib/ruby/gems/1.9.1/gems/capybara-webkit-0.8.0 for verification. Results recorded in c: /Ruby193/lib/ruby/gems/1.9.1/gems/capybara-webkit-0.8.0 /./ gem_make.out

+1
source share
1 answer

I got similar errors with this, as well as errors like:

g++.exe: unrecognized option '-headerpad_max_install_names'

make[1]: Leaving directory /ruby/gems/shared/gems/capybara-webkit-0.12.1/src'

Errno::ENOENT: No such file or directory - C:/JRuby/lib/ruby/gems/shared/gems/capybara-webkit-0.12.1/src/webkit_server

LoadError: no such file to load

No such file or directory - C:/Ruby/capybara-webkit-0.12.1/src/webkit_server

Basically, the answer to all these errors is related to the version of capybara-webkit that you install on Windows, depending on the correct QT versions, and the correct version of the g ++ compiler included in the mingw toolkit. The correct versions must be installed and the correct bin directories added to your window path.

In addition, there are problems with RbConfig::CONFIG['host_os'] , which on windows 8 return "mswin32" rather than "mingw32". Therefore, you need to fix capybara_webkit_builder.rb and spec_helper.rb as follows: /mingw32|mswin32/ . If you do not, you will run macx-g ++, which will not work on Windows. You must run win32-g ++ in windows.

If you use JRuby, then RUBY_PLATFORM set to java. Therefore, you need to change the corresponding capybara_webkit_builder.rb and connection.rb to /mingw32|java/ . If you do not, then the binary will be compiled (but with a connection error), but the compiler will fail with a webkit server error.

You must complete the installation of the script at https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit

In the final window instruction, you need to β€œcd” into the gem directory, and then run

 bundle exec gem install capybara-webkit-0.12.1.gem 

or any other version you created.

So, the answers get all the correct versions of each dependency, fix errors, ensure that the Windows path variable points to the correct g ++ compilers (remember to restart cmd after you change the path variable), and then make sure you are in the correct directory when running commands.

0
source

Source: https://habr.com/ru/post/1440322/


All Articles