问题
Issue
I am unable to get Capybara-webkit 1.0.0 to install into my Rails 3.2.10 project.
When I run bundle install
I get the following errors.
Also when I roll capybara-webkit back to version 0.12.1
(May 30, 2012) it installs fine.
Note: I am having this same problem on both OSX 10.8 and Ubuntu 10.04
Errors
An error occurred while installing capybara-webkit (1.0.0) with bundler
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
Thoughts
- It seems to be related to QT even though I have the recommended 4.8.5 installed
My configuration
- Ubuntu 10.04
- Postgres 9.2
- QT 4.8.5 for capybara support
- Redis version 1.2.0
- Rbenv 0.4.0-54
- Ruby 1.9.3-p392
- Gem 1.8.23
- Bundler 1.3.5
- Rails 3.2.10
- capybara-webkit 1.0.0
My Gemfile
Here is the Gemfile:
source 'http://rubygems.org'
ruby "1.9.3"
gem "builder"
gem 'unicorn'
gem 'rails', '3.2.10'
gem 'sass-rails', "~> 3.2.3"
gem 'jquery-rails'
gem 'pg'
gem 'appsignal'
gem 'appsignal-redis'
gem 'skylight'
gem "rollbar", "~> 0.10.12"
gem 'exceptional'
gem 'forem', :git => "git://github.com/radar/forem.git"
gem 'forem-postgres-search', :git=>"git://github.com/jgadbois/forem-postgres-search.git"
gem 'forem-theme-base', :path=>'vendor/gems/forem-theme-wt'
gem 'forem-markdown_formatter', :git => "git://github.com/jgadbois/forem-markdown_formatter.git"
group :assets do
gem 'coffee-rails', "~> 3.2.1"
gem 'uglifier', '>= 1.0.3'
end
group :production do
gem 'dalli', :git=>'git://github.com/mperham/dalli.git'
gem 'rpm_contrib'
gem 'newrelic_rpm'
gem 'memcachier'
end
group :test do
gem "factory_girl_rails", "~> 3.0"
gem 'capybara'
gem 'capybara-webkit'
gem 'rspec-rails', ">= 2.14"
gem 'database_cleaner'
gem 'spring'
gem 'selenium-webdriver'
end
group :development, :test do
gem 'guard-rspec', "~> 2.5"
gem 'guard-livereload'
gem 'better_errors'
gem 'binding_of_caller'
gem 'meta_request'
gem 'rb-fsevent', '~> 0.9'
gem 'rack-livereload'
end
gem 'heroku', ">= 2.40"
gem 'resque'
gem 'resque-web'
gem "hiredis", "~> 0.4.0"
gem "redis", "~> 3.0", :require => ["redis/connection/hiredis", "redis"]
gem 'resque_mailer'
gem "hirefire-resource"
gem 'cancan'
gem 'devise'
gem 'devise-encryptable'
gem "omniauth-facebook"
gem 'paperclip'
gem 'aws-sdk'
gem "rake", '0.9.2.2'
gem 'friendly_id', '~> 4.0.10'
gem 'hpricot'
gem 'kaminari'
gem "simple-navigation"
gem 'ransack'
gem 'amazon-product-advertising-api'
gem 'ckeditor'
gem "activemerchant", :git => 'git://github.com/Shopify/active_merchant.git'#:git => 'git://github.com/jgadbois/active_merchant.git'
gem 'stripe'
gem 'acts-as-taggable-on'
gem 'carrierwave'
gem 'ancestry'
gem 'geocoder'
gem 'profanity_filter'
source "http://gems.github.com"
gem "feedzirra"
gem "grackle"
gem "rmagick"
gem 'hominid'
gem "letter_opener", :group => :development
gem 'rack-contrib'
gem 'soulmate', :require => 'soulmate/server', :github => 'jgadbois/soulmate'
gem 'wicked_pdf', :git => 'git://github.com/mileszs/wicked_pdf.git'
gem 'dynamic_form'
gem "SystemTimer", :require => "system_timer", :platforms => :ruby_18
gem "rack-timeout"
gem 'pusher'
gem 'bourbon'
gem 'client_side_validations'
gem 'roadie'
gem 'rails_autolink'
gem 'leaderboard', "~> 2.2.0"
gem 'wicked'
gem 'rack-rewrite'
gem 'select2-rails'
gem 'koala'
gem 'health_graph'
gem 'twilio-ruby'
gem 'country_select'
gem 'oauth'
gem 'mandrill-api', '>= 1.0.41'
gem "active_model_serializers", "~> 0.8.0"
gem "heroku-api"
gem "bust_rails_etags"
gem 'cache_digests'
gem 'activerecord-postgres-hstore'
回答1:
You first need to install Qt. Try these instructions: https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit
回答2:
That's a heck of a lot of gems. First thing to try is to make sure you have the necessary version of Capybara (greater than 2.0.2):
gem 'capybara', '>= 2.0.2'
If that doesn't help, try commenting out blocks of your included gems until the gemfile will build. Once it does, you can try uncommenting different gems until it fails again. Then you will at least know where the conflict is so that you can try to resolve it. More info on capybara-webkit
dependencies here: http://rubygems.org/gems/capybara-webkit
回答3:
You need to install the libraries needed to compile the gem:
# ubuntu
sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui
来源:https://stackoverflow.com/questions/18804801/problems-installing-capybara-webkit-1-0-0-in-rails-3-2-10-on-ubuntu-10-04