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.