Jake Myers
Jake Myers

Reputation: 161

Capybara Webkit - Unable to start server

After pulling down an existing Rails project to my local machine, running the test suite throws an error when trying to run our feature tests which use the capybara-webkit gem. The tests run fine on all the other dev machines, as well as Codeship, so it has been narrowed down to my machine.

The first error when running the specs:

dyld: Library not loaded: @rpath/lib/QtWebKit.framework/Versions/4/QtWebKit
  Referenced from: /Users/myname/.rvm/gems/ruby-1.9.3-p448myproject/gems/capybara-webkit-1.2.0/bin/webkit_server
  Reason: image not found

From what I can gather, it's looking for the webkit_server executable and can't find it. So I did a search for it myself and found it here:

/usr/local/Cellar/qt/4.8.6/lib/QtWebKit.framework/Versions/4

So the discrepancy here is in @rpath from what I can tell. I guess the question here is where is @rpath pointing, and where should my QtWebkit.framework be?

The second error when running the specs:

An error occurred in an after hook
  Errno::EADDRNOTAVAIL: Can't assign requested address - connect(2)
  occurred at /Users/myname/.rvm/gems/ruby-1.9.3-p448@myproject/gems/capybara-webkit-1.2.0/lib/capybara/webkit/connection.rb:84:in `initialize'

I'm assuming this is a byproduct of the previous error, but have included it anyway.

So far, we've done a few other things to try and remedy the situation:

Upvotes: 2

Views: 1956

Answers (2)

Малъ Скрылевъ
Малъ Скрылевъ

Reputation: 16507

I've used the cheat code to increase the WEBKIT_SERVER_START_TIMEOUT constant time.

Capybara::Webkit.configure do |config|                                             
   config.class.parent::Connection.send(:remove_const,:WEBKIT_SERVER_START_TIMEOUT)   
   config.class.parent::Connection::WEBKIT_SERVER_START_TIMEOUT = 30                  
end   

Upvotes: 0

Seaborn Lee
Seaborn Lee

Reputation: 31

After searched for a long time, I finally found that capybara-webkit version is the problem. So update your gem capybara-webkit should fix this. At least it solved my problem.

Upvotes: 1

Related Questions