# New to Circle CI, having issues with mutiple orbs

**URL:** <https://discuss.circleci.com/t/new-to-circle-ci-having-issues-with-mutiple-orbs/49322>\
**Category:** Orbs\
**Tags:** circle-yml, docker\
**Created:** [September 21, 2023, 7:42pm UTC](https://discuss.circleci.com/t/new-to-circle-ci-having-issues-with-mutiple-orbs/49322 "2023-09-21T19:42:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ali\_Ahmad](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@Ali\_Ahmad](https://discuss.circleci.com/u/Ali_Ahmad)\
**Post date:** [September 21, 2023, 7:42pm UTC](https://discuss.circleci.com/t/new-to-circle-ci-having-issues-with-mutiple-orbs/49322/1 "2023-09-21T19:42:26Z")

</div>

```auto
version: 2.1

orbs:
  ruby: circleci/ruby@2.0.1
  node: circleci/node@5.0

jobs:
  build:
    resource_class: large
    working_directory: ~/vendors
    docker:
      - image: cimg/node:lts
      - image: cimg/ruby:2.7.7
    executor: ruby/default
    steps:
      - checkout
      - run:
          name: Which bundler?
          command: bundle -v
      - run:
          name: Which node?
          command: node -v
      - run: bundle install
      - run: npm install
      - run: cypress run
      - store_artifacts:
          path: /root/vendors/cypress/screenshots/
          destination: screenshot

```

This is how my image looks like, the orbs are not working, the second orb runs as a container but it doesnt happen with the 1st one.

---

<div class="post-metadata">

**Author:** ![rit1010](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rit1010/32/34738_2.png) [@rit1010](https://discuss.circleci.com/u/rit1010)\
**Post date:** [September 22, 2023, 9:38am UTC](https://discuss.circleci.com/t/new-to-circle-ci-having-issues-with-mutiple-orbs/49322/2 "2023-09-22T09:38:25Z")

</div>

What error messages are you seeing and at what point?

One thing the revision of the ORBs you have included are not current, you may want to try and update them to their latest releases.

---

<div class="post-metadata">

**Author:** ![rit1010](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rit1010/32/34738_2.png) [@rit1010](https://discuss.circleci.com/u/rit1010)\
**Post date:** [September 22, 2023, 10:21am UTC](https://discuss.circleci.com/t/new-to-circle-ci-having-issues-with-mutiple-orbs/49322/3 "2023-09-22T10:21:50Z")

</div>

One key thing, you are aware of what environment you are defining

As it stands you are creating an environment using a large instance of cimg/node:lts and then creating a docker container within this environment that is running cimg/ruby:2.7.7

As such this is an independent docker container that you can use docker commands to remotely access, but it has not added ruby to the main environment, so you do not have ruby available for your config.yml script.

This is detailed here

> **[Using the Docker execution environment - CircleCI](https://circleci.com/docs/using-docker/)**
>
> Learn how to configure a your jobs to run in the Docker execution environment

If you instead select cimg/ruby:2.7.7 as the image to load you will end up with an environment that has both ruby and node available.

Images and ORBs are very different things, with the images being OS based containers, while the ORBs are just pre-built scripts that extend the functionality of the config.yml environment.

---

<div class="post-metadata">

**Author:** ![Ali\_Ahmad](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@Ali\_Ahmad](https://discuss.circleci.com/u/Ali_Ahmad)\
**Post date:** [September 22, 2023, 12:43pm UTC](https://discuss.circleci.com/t/new-to-circle-ci-having-issues-with-mutiple-orbs/49322/4 "2023-09-22T12:43:21Z")

</div>

Hi, thank you for replying, it means a lot.

> If you instead select cimg/ruby:2.7.7 as the image to load you will end up with an environment that has both ruby and node available.

By this you mean, if I select ruby first then node will be automatically installed? I won’t have to do cimg/node:lts or do I? because i tried with just ruby only but it didn’t work because I need node to install cypress and plugins. Whatever command I use first, I always end up with a container that takes forever to build and in the end it gets stopped.

> app.screencast com/kjfyrKfmM2ytI

---

<div class="post-metadata">

**Author:** ![rit1010](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rit1010/32/34738_2.png) [@rit1010](https://discuss.circleci.com/u/rit1010)\
**Post date:** [September 22, 2023, 1:05pm UTC](https://discuss.circleci.com/t/new-to-circle-ci-having-issues-with-mutiple-orbs/49322/5 "2023-09-22T13:05:42Z")

</div>

You would only select the ruby image and not try and also load the node image.

Now the time-out is being caused by the bundle command, which I know nothing about, but after a quick search can you try the following commands instead

gem list bundler - you should have gem install and this lists the versions of bundler it knows about

gem install bundler - will install the current version

If you read the docs for the ruby ORB you will see that it has a number of commands to set up a working environment. The ‘ruby/install-deps’ command includes the installing of bundle.

---

<div class="post-metadata">

**Author:** ![Ali\_Ahmad](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@Ali\_Ahmad](https://discuss.circleci.com/u/Ali_Ahmad)\
**Post date:** [September 22, 2023, 1:20pm UTC](https://discuss.circleci.com/t/new-to-circle-ci-having-issues-with-mutiple-orbs/49322/6 "2023-09-22T13:20:18Z")

</div>

If I won’t select or load the node image then how can i make npm install work? I tried your given commands, i got the same error, bundle -v didn’t work. I changed my config a bit

```auto
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/configuration-reference
version: 2.1

# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects.
# See: https://circleci.com/docs/orb-intro/
orbs:
  ruby: circleci/ruby@2.0.1
  #node: circleci/node@5.0

# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/configuration-reference/#jobs
jobs:
  build:
    resource_class: large
    working_directory: ~/vendors
    docker:
      - image: cimg/ruby:2.7.7
      - image: cimg/node:lts
    executor: ruby/default
    steps:
      - checkout
      - run:
          name: Which bundler?
          command: bundle -v
      - run:
          name: Which node?
          command: node -v
      #- ruby/install-deps
      - run: gem list bundler
      - run: gem install bundler
      #- run: bundle update paper_trail --full-index  
      - run: bundle install
      - run: npm install
      - run: cypress run
      - store_artifacts:
          path: /root/vendors/cypress/screenshots/
          destination: screenshot

# Orchestrate jobs using workflows
# See: https://circleci.com/docs/configuration-reference/#workflows
workflows:
  sample: # This is the name of the workflow, feel free to change it to better match your workflow.
    # Inside the workflow, you define the jobs you want to run.
    jobs:
      - build

```

Basically, I just want the node to be installed app.screencast com/TITDp1J8OGaTz

---

<div class="post-metadata">

**Author:** ![rit1010](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rit1010/32/34738_2.png) [@rit1010](https://discuss.circleci.com/u/rit1010)\
**Post date:** [September 22, 2023, 1:38pm UTC](https://discuss.circleci.com/t/new-to-circle-ci-having-issues-with-mutiple-orbs/49322/7 "2023-09-22T13:38:10Z")

</div>

My mistake you need to switch the ruby image you are using. The available images are listed here

> **[cimg/ruby - CircleCI](https://circleci.com/developer/images/image/cimg/ruby)**
>
> A Ruby Docker image built to run on CircleCI that contains ruby, gem and bundle

If you scroll down the list you can see what installed software packages are included in each image and choose one that meets your needs.

Once you have the base image you then just use standard commands to add additional features, such as the bundle tool.

We are also talking about different aspects of the config.yml. I am referring to the docker images, not the ORBs. Within the script you have posted, you are currently not making any use of the ORBs as you are not calling any of the ORB-provided commands.

You may want to look at the example script ruby\_rails\_sample\_app provided for the ruby ORB at

> **[CircleCI Developer Hub - circleci/ruby](https://circleci.com/developer/orbs/orb/circleci/ruby)**
>
> Easily cache and install your Ruby Gems automatically, run parallel Rspec tests, or just install Ruby.

This shows the docker image cimg/ruby:2.7-node being used as the system image and then the ORBs being used to set up the required environments for both ruby and node. Just look at the defined build job without worrying about the rest of the example as they have put a lot of features into a single example and so made it overly complicated.

---

<div class="post-metadata">

**Author:** ![wyardley](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/wyardley/32/19231_2.png) [@wyardley](https://discuss.circleci.com/u/wyardley)\
**Post date:** [September 22, 2023, 11:45pm UTC](https://discuss.circleci.com/t/new-to-circle-ci-having-issues-with-mutiple-orbs/49322/8 "2023-09-22T23:45:01Z")

</div>

If your goal is to have a specific version of node installed on a ruby executor, you could do a few things:

- Use the node variant of the ruby CIMG image: [cimg/ruby - CircleCI](https://circleci.com/developer/images/image/cimg/ruby?utm_source=google&utm_medium=sem&utm_campaign=sem-google-dg--uscan-en-dsa-tROAS-auth-nb&utm_term=g_-_c__dsa_&utm_content=#node.js) (e.g., `image: cimg/ruby:3.2.2-node`).
- Use the native package manager of the base OS (`apt` for Debian / Ubuntu, or `apk` for Alpine) to install node, either from the vendor’s repo or from a third party one like nodesource.
- Use the install _command_ (not job) as part of a set of `steps` from the node orb: [CircleCI Developer Hub - circleci/node](https://circleci.com/developer/orbs/orb/circleci/node#commands-install)
