Ruby/Rails: Capybara-webkit gem failing to install [Solved]


The capybara-webkit gem is failing to install due to missing libraries which I suspect is the qt library. I’ve tried adding the docker image but the problem still persists. Is there a particular way I have to set this up? Here’s my circle config:

version: 2
    working_directory: ~/app
      - image: circleci/ruby:2.4.1-node
      - image: circleci/postgres:9.6.3-alpine
      - image: redis:3.2
      - image: fxposter/qt-ruby
      - checkout

      # Download and cache dependencies
      - restore_cache:
          - app-dependencies-{{ checksum "Gemfile.lock" }}
          # fallback to using the latest cache if no exact match is found
          - app-dependencies-

      - run:
          name: install dependencies
          command: |
            bundle install --jobs=4 --retry=3 --path vendor/bundle

      - save_cache:
            - ./venv
          key: app-dependencies-{{ checksum "Gemfile.lock" }}

      # Database setup
      - run: bundle exec rake db:create
      - run: bundle exec rake db:schema:load

      # Run bundler audit
      - type: shell
        command: |
          bundle exec rake bundler:audit

      # Run rubocop
      - type: shell
        command: |
          bundle exec rake rubocop

      # Run i18n checks
      - type: shell
        command: |
          bundle exec rake i18n

      # run tests!
      - run:
          name: run tests
          command: |
            mkdir /tmp/test-results
            TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"

            bundle exec rspec --format progress \
                            --format RspecJunitFormatter \
                            --out /tmp/test-results/rspec.xml \
                            --format progress \

      # collect reports
      - store_test_results:
          path: /tmp/test-results
      - store_artifacts:
          path: /tmp/test-results
          destination: test-results


So there appears to be different information on setting up a circle config for a ruby on rails app in the docs but i’ve managed to get this to work by including the step below before my bundle install.

- run:
  name: Install System Dependencies
  command: sudo apt-get install qt5-default libqt5webkit5-dev gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x

  • run:
    name: Install capybara-webkit
    command: |
    apt-get update
    apt-get install -y software-properties-common
    apt install -y gcc g++ make qt5-default libqt5webkit5-dev ruby-dev zlib1g-dev


This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.