Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Capybara::Webkit::ConnectionError webkit_server failed to start #678

Closed
firedev opened this issue Oct 27, 2014 · 18 comments
Closed

Capybara::Webkit::ConnectionError webkit_server failed to start #678

firedev opened this issue Oct 27, 2014 · 18 comments

Comments

@firedev
Copy link

firedev commented Oct 27, 2014

After accidentally wiping out the whole brew directory I reinstalled ruby and Homebrew. Now my feature tests are randomly failing with the following:

Capybara::Webkit::ConnectionError: /Users/pain/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/capybara-webkit-1.3.1/bin/webkit_server failed to start.
occurred at /Users/pain/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/capybara-webkit-1.3.1/lib/capybara/webkit/connection.rb:75:in `parse_port'

Gems and Ruby installed:

ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin14.0]
  * capybara (2.4.4)
  * capybara-webkit (1.3.1)

Any ideas?

@firedev
Copy link
Author

firedev commented Oct 27, 2014

Okay my bad, forgot to add qt and reinstall capybara. False alarm, sorry.

@firedev firedev closed this as completed Oct 27, 2014
@onebree
Copy link

onebree commented Feb 18, 2015

When you say, "add qt", do you mean as a gem or as a package?

@firedev
Copy link
Author

firedev commented Mar 6, 2015

As a package. brew install qt I think.

@justin808
Copy link

This might fix the issue, if you installed qt5:

gem uninstall capybara-webkit
QMAKE=/usr/local/Cellar/qt5/5.4.0/bin/qmake bundle install

@watsonbox
Copy link

@justin808 Thanks for the tip. This got capybara-webkit installed and working with qt5 for me.

@3zcurdia
Copy link

I reinstalled qt and later capybara-webkit and nothing any idea?

@jferris
Copy link
Contributor

jferris commented Aug 17, 2015

@3zcurdia can you try starting the webkit_server program from the bin directory in the installed gem? It may print an error explaining why it can't start.

@3zcurdia
Copy link

I got this

  QXcbConnection: Could not connect to display 
  Aborted (core dumped

@jferris
Copy link
Contributor

jferris commented Aug 20, 2015

@3zcurdia what system are you on? If you're on a Linux system, do you have X running? If you're running headlessly, you may want xvfb or something similar.

@3zcurdia
Copy link

ubuntu server 14.04 and I am using xvfb

@leomayleomay
Copy link

same error here

capybara 2.4.4
capybara-webkit 1.3.1

once i ran the webkit_server, it raised an error saying:

 QXcbConnection: Could not connect to display 
 Aborted (core dumped

@leomayleomay
Copy link

turns out the doc has already given out the answer to the problem

https://github.com/thoughtbot/capybara-webkit#ci

@indiesquidge
Copy link

System: OS X 10.11 - El Capitan
Ruby: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
capybara: 2.5.0
capybara-webkit: 1.7.1


I was getting the same error as OP.

/Users/austinwood/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/capybara-webkit-1.7.1/bin/webkit_server failed to start.

My fix:

gem uninstall capybara-webkit
brew install qt5
brew linkapps qt5
brew link --force qt5
gem install capybara-webkit

source for installing qt5 and compiling capybara-webkit to work with it.

@olivierlacan
Copy link
Contributor

Has anyone here tried to use the Headless gem instead of xvfb-run -a bundle exec rspec spec/?

Additionally, the documentation @leomayleomay mentioned doesn't explain what the DISPLAY variable should be used for or set to, that might be helpful.

@jwg2s
Copy link

jwg2s commented Nov 9, 2015

@indiesquidge thanks, that worked 👍

@d1rtyvans
Copy link

@indiesquidge's solution worked for me as well! 👍

@dalvizu
Copy link

dalvizu commented Oct 4, 2016

I saw this error using the headless gem and calling headless.destroy() instead of headless.stop() at the end of my tests. Changing to stop() fixed the issue.

@henrik
Copy link

henrik commented Nov 28, 2018

Regarding @justin808's fix: to uninstall the gem if it was installed by bundler, do:

bundle exec gem uninstall capybara-webkit

Sadly this didn't fix the issue for us :D Turned out it worked fine without reinstalling the gem if we did what @leomayleomay says above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests