Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running rspec in Circle CI #12

Open
plamenGo opened this issue Nov 9, 2018 · 2 comments
Open

Running rspec in Circle CI #12

plamenGo opened this issue Nov 9, 2018 · 2 comments

Comments

@plamenGo
Copy link

plamenGo commented Nov 9, 2018

Hey guys, the sample .circleci config does not work for me. It always chokes on not being able to find bundle. All I'm trying to do is run rspec on .circle ci.

This is the config I have so far:

version: 2
jobs:
build:
parallelism: 3
docker:
- image: circleci/ruby:2.4.2-jessie-node
environment:
BUNDLE_JOBS: 3
BUNDLE_RETRY: 3
BUNDLE_PATH: vendor/bundle
TERRAFORM_VERSION: 0.10.8
PATH: "${PATH}:${HOME}/.bin"

  - image: circleci/postgres:9.6
    environment:
      POSTGRES_PASSWORD: abcd1234!!

  - image: "redis:3.2.6"

steps:
  - checkout

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

  - run:
      name: Bundle Install
      command: bundle check || bundle install
  
  - run:
      name: Run rspec
      command: |
        bundle exec rspec
      environment:
        RAILS_ENV: test
        DB_HOST: postgres
        DB_NAME: phisher_test
        DB_USERNAME: postgres
        DB_PASSWORD: abcd1234!!
        REDIS_HOST: redis
        JWT_SECRET: dev
        COMPILER_ADDR: 10.12.0.22:5030
        ELASTICSEARCH_HOST: localhost

And this is the output where it fails:

Which bundler? (0)00:00
Exit code: 127
#!/bin/bash -eo pipefail
bundle -v
/bin/bash: bundle: command not found
Exited with code 127

@AlecRust
Copy link

Same issue, I have to install bundler manually. Should it somehow be available without this?

@jasonfb
Copy link

jasonfb commented Oct 6, 2021

jobs:
  build:
    executor: default
    steps:
      - run:
          name: Force Bundler Version
          command: |
            sudo gem update --system
            echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
            source $BASH_ENV
            gem install bundler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants