Fix Windows Compilation #300

wants to merge 31 commits into


None yet

7 participants


Hi all,

this fixes Windows compilation by skipping LANG settings before calling make.
The relevant fixes are in lib/capybara_webkit_builder.rb.

all specs green on Windows Vista 32Bit and Ruby 1.9.3-p0.



On my configuration (Windows XP 32bit, ruby 1.9.2, rails 3.2.2 - more details here: #188 (comment)), using commit f8cd499, Capybara-webkit can be installed and works well.

thoughtbot, inc. member

@morenocarullo can you submit a pull request that contains only the fixes you'd like merged on their own branch? We'd also prefer branches without merge commits, since we have to clean those out ourselves anyway.

thoughtbot, inc. member

This diff is tricky to read since there are also some style changes but in summary:

  • nokogiri was changed from 1.5.0 to 1.5.0-x86-mingw32
  • RUBY_PLATFORM was changed to RbConfig::CONFIG['host_os']
  • The capybara_webkit_builder.rb sets the LANG env variable only for non-mingw32

Is the Gemfile.lock change appropriate?

Is RUBY_PLATFORM incorrect? Why RbConfig?

Is the underlying issue that environment variables cannot be passed like that? Is there a uniform way to set env vars across platform?


Gemfile.lock change is ok, it should add the windows version so on unix the standard version is used.

The RUBY_PLATFORM was change to RbConfig since it is better for JRuby integration, see a previous commit where all RUBY_PLATFORM were change to RbConfig. Feel free to change it otherwise, it works with both methods on MRI/Windows.

On Windows the 'subshell' is not as smart as on unix, so you cannot pass env vars that way.

baconpat and others added some commits Mar 22, 2012
@baconpat baconpat Rather than creating a new NetworkAccessManager when the page is reset,
reuse the existing manager and just clear its headers and cookies.

This avoids repeatedly setting up the SIGNAL/SLOT callback stuff which
is leading to unclosed pipes on Ubuntu, eventually causing "too many
open files" errors in large test suites.
@tomlea tomlea Add a resize_window method to the driver.
Allow users to resize the webkit viewport via
Capybara::Driver::Webkit#resize_window(width, height).

This can be called before or after page load, and fires resize events as expected.
@tomlea tomlea Set the window to the default size on #reset!
This should prevent state leakage between test cases.
@jferris jferris Document unofficial driver methods 7361822
thoughtbot, inc. member

@morenocarullo Whenever I get a chance, I'll look through the diff again to try and figure out what the actual changes are to pull in. However, you can make this much faster by:

  • Creating a new remote branch in your repository
  • Adding a single commit with just the changes you want
  • Not including indentation or other formatting changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment