Error installing gem capybara-webkit

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

Solution 1:

Try installing libqt via homebrew.

$ brew install [email protected]

Solution 2:

Solution for Linux.

Ubuntu

sudo apt-get install libqt4-dev libqtwebkit-dev

Debian Stable

sudo apt-get install libqt4-dev

Fedora

yum install qt-webkit-devel

Fedora 16

yum install qtwebkit-devel

This works for me maybe it will be also helpful for somebody.