CircleCI 2.0 - exit code 127, bundle command not found









up vote
0
down vote

favorite












I'm trying to get a rails app to run on Circle CI. With the following configuration I can't seem to get anything to work at all. When I ssh in, I can't even run sudo.



Here's the error output:



install dependencies
$ #!/bin/bash -eo pipefail
bundler install --jobs=4 --retry=3 --path vendor/bundle
/bin/bash: bundler: command not found
Exited with code 127


I noticed there is nothing but assets/ under the vendor directory.



Here's my configuration file:



version: 2
jobs:
build:
working_directory: ~/repo
docker:
- image: circleci/postgres:9.6-alpine-postgis-ram

- image: circleci/ruby:2.3
environment:
PGHOST: 127.0.0.1
PGUSER: staging
RAILS_ENV: test

- image: circleci/postgres:10.5
environment:
POSTGRES_USER: staging
POSTGRES_DB: test
POSTGRES_PASSWORD: ""

steps:
- checkout

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

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

- save_cache:
paths:
- ./vendor/bundle
key: v1-dependencies- checksum "Gemfile.lock"

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

# 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
$TEST_FILES

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


All help is appreciated, thanks!










share|improve this question

























    up vote
    0
    down vote

    favorite












    I'm trying to get a rails app to run on Circle CI. With the following configuration I can't seem to get anything to work at all. When I ssh in, I can't even run sudo.



    Here's the error output:



    install dependencies
    $ #!/bin/bash -eo pipefail
    bundler install --jobs=4 --retry=3 --path vendor/bundle
    /bin/bash: bundler: command not found
    Exited with code 127


    I noticed there is nothing but assets/ under the vendor directory.



    Here's my configuration file:



    version: 2
    jobs:
    build:
    working_directory: ~/repo
    docker:
    - image: circleci/postgres:9.6-alpine-postgis-ram

    - image: circleci/ruby:2.3
    environment:
    PGHOST: 127.0.0.1
    PGUSER: staging
    RAILS_ENV: test

    - image: circleci/postgres:10.5
    environment:
    POSTGRES_USER: staging
    POSTGRES_DB: test
    POSTGRES_PASSWORD: ""

    steps:
    - checkout

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

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

    - save_cache:
    paths:
    - ./vendor/bundle
    key: v1-dependencies- checksum "Gemfile.lock"

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

    # 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
    $TEST_FILES

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


    All help is appreciated, thanks!










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm trying to get a rails app to run on Circle CI. With the following configuration I can't seem to get anything to work at all. When I ssh in, I can't even run sudo.



      Here's the error output:



      install dependencies
      $ #!/bin/bash -eo pipefail
      bundler install --jobs=4 --retry=3 --path vendor/bundle
      /bin/bash: bundler: command not found
      Exited with code 127


      I noticed there is nothing but assets/ under the vendor directory.



      Here's my configuration file:



      version: 2
      jobs:
      build:
      working_directory: ~/repo
      docker:
      - image: circleci/postgres:9.6-alpine-postgis-ram

      - image: circleci/ruby:2.3
      environment:
      PGHOST: 127.0.0.1
      PGUSER: staging
      RAILS_ENV: test

      - image: circleci/postgres:10.5
      environment:
      POSTGRES_USER: staging
      POSTGRES_DB: test
      POSTGRES_PASSWORD: ""

      steps:
      - checkout

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

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

      - save_cache:
      paths:
      - ./vendor/bundle
      key: v1-dependencies- checksum "Gemfile.lock"

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

      # 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
      $TEST_FILES

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


      All help is appreciated, thanks!










      share|improve this question













      I'm trying to get a rails app to run on Circle CI. With the following configuration I can't seem to get anything to work at all. When I ssh in, I can't even run sudo.



      Here's the error output:



      install dependencies
      $ #!/bin/bash -eo pipefail
      bundler install --jobs=4 --retry=3 --path vendor/bundle
      /bin/bash: bundler: command not found
      Exited with code 127


      I noticed there is nothing but assets/ under the vendor directory.



      Here's my configuration file:



      version: 2
      jobs:
      build:
      working_directory: ~/repo
      docker:
      - image: circleci/postgres:9.6-alpine-postgis-ram

      - image: circleci/ruby:2.3
      environment:
      PGHOST: 127.0.0.1
      PGUSER: staging
      RAILS_ENV: test

      - image: circleci/postgres:10.5
      environment:
      POSTGRES_USER: staging
      POSTGRES_DB: test
      POSTGRES_PASSWORD: ""

      steps:
      - checkout

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

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

      - save_cache:
      paths:
      - ./vendor/bundle
      key: v1-dependencies- checksum "Gemfile.lock"

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

      # 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
      $TEST_FILES

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


      All help is appreciated, thanks!







      ruby-on-rails ruby circleci






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 10 at 21:43









      styler1972

      11k1560112




      11k1560112






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          Your commands are running on the postgres container because it is listed first. If you make the ruby container first, then you will have access to bundle. And then when you SSH, you will be inside of the ruby container.



          https://circleci.com/docs/2.0/configuration-reference/#docker--machine--macosexecutor




          The first image listed in the file defines the primary container image where all steps will run.







          share|improve this answer




















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243701%2fcircleci-2-0-exit-code-127-bundle-command-not-found%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted










            Your commands are running on the postgres container because it is listed first. If you make the ruby container first, then you will have access to bundle. And then when you SSH, you will be inside of the ruby container.



            https://circleci.com/docs/2.0/configuration-reference/#docker--machine--macosexecutor




            The first image listed in the file defines the primary container image where all steps will run.







            share|improve this answer
























              up vote
              1
              down vote



              accepted










              Your commands are running on the postgres container because it is listed first. If you make the ruby container first, then you will have access to bundle. And then when you SSH, you will be inside of the ruby container.



              https://circleci.com/docs/2.0/configuration-reference/#docker--machine--macosexecutor




              The first image listed in the file defines the primary container image where all steps will run.







              share|improve this answer






















                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                Your commands are running on the postgres container because it is listed first. If you make the ruby container first, then you will have access to bundle. And then when you SSH, you will be inside of the ruby container.



                https://circleci.com/docs/2.0/configuration-reference/#docker--machine--macosexecutor




                The first image listed in the file defines the primary container image where all steps will run.







                share|improve this answer












                Your commands are running on the postgres container because it is listed first. If you make the ruby container first, then you will have access to bundle. And then when you SSH, you will be inside of the ruby container.



                https://circleci.com/docs/2.0/configuration-reference/#docker--machine--macosexecutor




                The first image listed in the file defines the primary container image where all steps will run.








                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 11 at 1:57









                katzenbar

                261




                261



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243701%2fcircleci-2-0-exit-code-127-bundle-command-not-found%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Use pre created SQLite database for Android project in kotlin

                    Darth Vader #20

                    Ondo