Error installing gem capybara-webkit

2019-01-30 17:22发布

I am new to ruby, but while trying to install capybara to run test on my system I get the following error. Im running OSX

my_app$ gem install capybara-webkit
Building native extensions.  This could take a while...
ERROR:  Error installing capybara-webkit:
ERROR: Failed to build gem native extension.

/Users/joe/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb

Gem files will remain installed in /Users/joe/.rvm/gems/ruby-1.9.2-p290/gems/capybara-webkit-0.7.2 for inspection.
Results logged to /Users/joe/.rvm/gems/ruby-1.9.2-p290/gems/capybara-webkit-0.7.2/./gem_make.out

here are results from gem_make.out

/Users/joe/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb

13条回答
疯言疯语
2楼-- · 2019-01-30 17:36
brew install qt@5.5

and then

gem install capybara-webkit -v '0.7.2'

-v 0.7.2 is to select version project is asking you to install. See that installing qt from http://developer.qt.nokia.com/wiki/Support_for_Mac_OS_X requires to set PATH variable.

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-01-30 17:38

I was able to get qt and capybara-webkit installed and working on OS X. I had to install Xcode so the build for

gem install capybara-webkit

would finish.

I also set this in my environment

Capybara.javascript_driver = :webkit

brew install qt5 to get latest qt.

The docs for it say that it conflicts with qt4, so be sure to remove that first with

brew uninstall [old qt]

Then it needs to be symlinked with

brew link --force qt5

查看更多
Lonely孤独者°
4楼-- · 2019-01-30 17:39

For fedora

yum install qt-webkit-devel
export QMAKE=/usr/bin/qmake-qt4
gem install capybara-webkit
查看更多
放荡不羁爱自由
5楼-- · 2019-01-30 17:46

I am using Yosemite and following commands has fixed my issue.

brew install qt
brew linkapps qt
gem install capybara-webkit
查看更多
够拽才男人
6楼-- · 2019-01-30 17:48

For OSX, I had to

brew install qt

and then

sudo gem install capybara-webkit -v '0.7.2'

without sudo it would error

查看更多
孤傲高冷的网名
7楼-- · 2019-01-30 17:51

Was having exactly this problem trying to install capybara-webdriver on CentOS 6 after installing QT.

Fixed the problem by adding the following to my PATH environment variable

/usr/lib64/qt4/bin/
查看更多
登录 后发表回答