Error using capybara-webkit (really QtWebKit webkit_server) on MacOS X due to libpng version incompatibility

a 夏天 提交于 2019-12-11 05:19:00

问题


I get the following error when trying to execute any capybara test using the capybara-webkit driver:

dyld: Library not loaded: /usr/X11/lib/libpng15.15.dylib Referenced from: /usr/local/Cellar/qt/4.8.0/lib/QtGui.framework/Versions/4/QtGui Reason: Incompatible library version: QtGui requires version 20.0.0 or later, but libpng15.15.dylib provides version 17.0.0 /Users/chris/.rvm/gems/ruby-1.9.2-p290/gems/capybara-webkit-0.9.0/lib/capybara/driver/webkit/browser.rb:200:in initialize': Can't assign requested address - connect(2) (Errno::EADDRNOTAVAIL) from /Users/chris/.rvm/gems/ruby-1.9.2-p290/gems/capybara-webkit-0.9.0/lib/capybara/driver/webkit/browser.rb:200:in open' from /Users/chris/.rvm/gems/ruby-1.9.2-p290/gems/capybara-webkit-0.9.0/lib/capybara/driver/webkit/browser.rb:200:in attempt_connect' from /Users/chris/.rvm/gems/ruby-1.9.2-p290/gems/capybara-webkit-0.9.0/lib/capybara/driver/webkit/browser.rb:194:in block in connect' from /Users/chris/.rvm/gems/ruby-1.9.2-p290/gems/capybara-1.1.2/lib/capybara/util/timeout.rb:13:in timeout' from /Users/chris/.rvm/gems/ruby-1.9.2-p290/gems/capybara-webkit-0.9.0/lib/capybara/driver/webkit/browser.rb:193:in connect' from /Users/chris/.rvm/gems/ruby-1.9.2-p290/gems/capybara-webkit-0.9.0/lib/capybara/driver/webkit/browser.rb:17:in initialize' from /Users/chris/.rvm/gems/ruby-1.9.2-p290/gems/capybara-webkit-0.9.0/lib/capybara/driver/webkit.rb:25:in new' from /Users/chris/.rvm/gems/ruby-1.9.2-p290/gems/capybara-webkit-0.9.0/lib/capybara/driver/webkit.rb:25:in initialize' from /Users/chris/.rvm/gems/ruby-1.9.2-p290/gems/capybara-webkit-0.9.0/lib/capybara/webkit.rb:5:in new' from /Users/chris/.rvm/gems/ruby-1.9.2-p290/gems/capybara-webkit-0.9.0/lib/capybara/webkit.rb:5:in block in <top (required)>' from /Users/chris/.rvm/gems/ruby-1.9.2-p290/gems/capybara-1.1.2/lib/capybara/session.rb:61:in call' from /Users/chris/.rvm/gems/ruby-1.9.2-p290/gems/capybara-1.1.2/lib/capybara/session.rb:61:in driver' from /Users/chris/.rvm/gems/ruby-1.9.2-p290/gems/capybara-1.1.2/lib/capybara/session.rb:157:in visit' from /Users/chris/.rvm/gems/ruby-1.9.2-p290/gems/capybara-1.1.2/lib/capybara/dsl.rb:161:in `visit'

I understand the problem is due to the version of libpng it appears to be attempting to use, but I'm not sure how to fix it. I've downloaded the latest libpng source and compiled it, but I'm assuming that there is something in the capybara-webkit gem installation where either the webkit binaries are getting linked against the ones shown in the stack trace or something. I'm just not sure how to fix it. Any guidance is appreciated.

I'm using Max OS X 10.7, Ruby 1.9.2, capybara version 1.1.2, and capybara-webkit 0.9.0.

EDIT: To answer the question in the comments - yes, Qt was installed using homebrew. I'm not sure what I would do differently though - are you suggesting doing something with LD_LIBRARY_PATH?


回答1:


I ran into this same issue and fixed it by completely removing qt and reinstalling, using the following steps.

Remove QT

brew uninstall qt
sudo python uninstall-qt.py (I think in /Developer/Tools)

Install QT

brew update
brew doctor - fix any issues
brew install qt4 or brew install qt4 --build-from-source


来源:https://stackoverflow.com/questions/9244688/error-using-capybara-webkit-really-qtwebkit-webkit-server-on-macos-x-due-to-li

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!