Bundler Error

bundler
rspec

#1

Hey all

I have a Rails 4.2.4 app running on Ruby 2.3.6 and Postgres 9.4.

I am having difficulties finding the root of the following error:

This is my config file:

version: 2
jobs:
  build:
    parallelism: 2

    docker:
      - image: circleci/ruby:2.3.6-node
        environment:
          BUNDLE_JOBS: 3
          BUNDLE_RETRY: 3
          BUNDLE_PATH: vendor/bundle
          RAILS_ENV: test
          PGHOST: 127.0.0.1
          PGUSER: ubuntu

      - image: circleci/postgres:9.4-alpine
        environment:
          POSTGRES_USER: ubuntu
          POSTGRES_DB: circle_ruby_test

    steps:
      - checkout

      # Which version of bundler?
      - run:
          name: Which bundler?
          command: bundle -v

      # Restore bundle cache
      - restore_cache:
          keys:
            - v1-bundle-{{ checksum "Gemfile.lock" }}
            - v1-bundle-

      # Bundle install dependencies
      - run:
          name: Install dependencies
          command: |
            sudo apt-get install qt5-default libqt5webkit5-dev gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x
            sudo apt install postgresql-client
            gem install bundler

      - run:
          name: Bundle Install
          command: bundle check || bundle install

      # Store bundle cache
      - save_cache:
          key: v1-bundle-{{ checksum "Gemfile.lock" }}
          paths:
            - vendor/bundle

      - run:
          name: Database Setup
          command: |
            cp config/database.yml.example config/database.yml
            cp config/sunspot.yml.example config/sunspot.yml

            bundle exec rake db:create db:structure:load --trace
            bundle exec rake sunspot:solr:start

      # Run specs
      - run:
          name: Run tests
          command: |
            bundle exec rake ci

      - type: shell
        name: Run tests
        command: |
          bundle exec rspec --profile 10 \
                            --format RspecJunitFormatter \
                            --out test_results/rspec.xml \
                            --format progress \
                            $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)

      # Save artifacts
      - store_test_results:
          path: /tmp/test-results

workflows:
  version: 2
  build:
    jobs:
      - build

Can someone please help me figure out what I am doing wrong ?

-H


#2

(Aside: when posting errors, please post them as text. Images are not compatible with search engines, screen-readers and clipboards, and force readers to transcribe information in order to run their own searches. Read more here. Your error output can be copied to the clipboard from the web UI and then pasted here in block-formatting. Thanks!).


#3

Good suggestion. Here it is:

bundle exec rspec --profile 10 \
                  --format RspecJunitFormatter \
                  --out test_results/rspec.xml \
                  --format progress \
                  $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
I, [2018-03-01T18:05:29.878135 #18884]  INFO -- : Reporting coverage data to Code Climate.
bundler: failed to load command: rspec (/home/circleci/project/vendor/bundle/bin/rspec)
I18n::MissingTranslationData: translation missing: en.#<RubyVM::InstructionSequence:0x0000000006efe470>
  /home/circleci/project/vendor/bundle/gems/i18n-0.9.1/lib/i18n.rb:319:in `handle_exception'
  /home/circleci/project/vendor/bundle/gems/i18n-0.9.1/lib/i18n.rb:169:in `translate'
  /home/circleci/project/vendor/bundle/gems/actionview-4.2.4/lib/action_view/helpers/translation_helper.rb:69:in `translate'
  /home/circleci/project/vendor/bundle/gems/rspec-support-3.7.0/lib/rspec/support.rb:28:in `require_relative'
  /home/circleci/project/vendor/bundle/gems/rspec-support-3.7.0/lib/rspec/support.rb:28:in `block in <module:Support>'
  /home/circleci/project/vendor/bundle/gems/rspec-support-3.7.0/lib/rspec/support.rb:19:in `block in define_optimized_require_for_rspec'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/world.rb:135:in `source_from_file'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/formatters/snippet_extractor.rb:18:in `source_from_file'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/formatters/snippet_extractor.rb:30:in `extract_expression_lines_at'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/formatters/exception_presenter.rb:218:in `read_failed_lines'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/formatters/exception_presenter.rb:163:in `failure_slash_error_lines'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/formatters/exception_presenter.rb:150:in `block in failure_lines'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/formatters/exception_presenter.rb:149:in `tap'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/formatters/exception_presenter.rb:149:in `failure_lines'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/formatters/exception_presenter.rb:34:in `colorized_message_lines'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/formatters/exception_presenter.rb:240:in `formatted_message_and_backtrace'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/formatters/exception_presenter.rb:86:in `fully_formatted_lines'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/formatters/exception_presenter.rb:78:in `fully_formatted'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/reporter.rb:166:in `notify_non_example_exception'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/configuration.rb:1927:in `rescue in load_spec_file_handling_errors'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/configuration.rb:1923:in `load_spec_file_handling_errors'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/configuration.rb:1496:in `block in load_spec_files'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/configuration.rb:1494:in `each'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/configuration.rb:1494:in `load_spec_files'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/runner.rb:100:in `setup'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/runner.rb:86:in `run'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/runner.rb:71:in `run'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/lib/rspec/core/runner.rb:45:in `invoke'
  /home/circleci/project/vendor/bundle/gems/rspec-core-3.7.0/exe/rspec:4:in `<top (required)>'
  /home/circleci/project/vendor/bundle/bin/rspec:23:in `load'
  /home/circleci/project/vendor/bundle/bin/rspec:23:in `<top (required)>'
Coverage = 46.51%. Sending report to https://codeclimate.com for branch circle_ci_2... Code Climate encountered an exception: I18n::MissingTranslationData
translation missing: en.#<RubyVM::InstructionSequence:0x00000000102c5de8>
/home/circleci/project/vendor/bundle/gems/i18n-0.9.1/lib/i18n.rb:319:in `handle_exception'
/home/circleci/project/vendor/bundle/gems/i18n-0.9.1/lib/i18n.rb:169:in `translate'
/home/circleci/project/vendor/bundle/gems/actionview-4.2.4/lib/action_view/helpers/translation_helper.rb:69:in `translate'
/home/circleci/project/vendor/bundle/gems/codeclimate-test-reporter-0.4.8/lib/code_climate/test_reporter/client.rb:94:in `write'
/home/circleci/project/vendor/bundle/gems/codeclimate-test-reporter-0.4.8/lib/code_climate/test_reporter/client.rb:94:in `write'
/home/circleci/project/vendor/bundle/gems/codeclimate-test-reporter-0.4.8/lib/code_climate/test_reporter/client.rb:94:in `compress'
/home/circleci/project/vendor/bundle/gems/codeclimate-test-reporter-0.4.8/lib/code_climate/test_reporter/client.rb:62:in `post_results'
/home/circleci/project/vendor/bundle/gems/codeclimate-test-reporter-0.4.8/lib/code_climate/test_reporter/formatter.rb:29:in `format'
/home/circleci/project/vendor/bundle/gems/simplecov-0.11.1/lib/simplecov/result.rb:46:in `format!'
/home/circleci/project/vendor/bundle/gems/simplecov-0.11.1/lib/simplecov/configuration.rb:168:in `block in at_exit'
/home/circleci/project/vendor/bundle/gems/simplecov-0.11.1/lib/simplecov/defaults.rb:64:in `block in <top (required)>'
zlib(finalizer): Zlib::GzipWriter object must be closed explicitly.
zlib(finalizer): the stream was freed prematurely.
Exited with code 1

#4

I tend to regard stack traces of that kind as not CI-specific in the first instance. See other people’s experiences here, including several mentions of a workaround on GitHub issues tickets. Any good?


#5

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