Gitlab deploy to heroku failure

,

*Gitlab fails to deploy to heroku when I push.


*

*I first encountered the issue then I referred to this link, however when I push gitlab throws a RuntimeError that "ensure adapter! ": An attempt
to run a request with a Faraday:: Connection without adapter has been made. *

    • CI configuration from .gitlab-ci.yml*
image: node:latest

before_script:
    - apt-get update -qy
    - apt-get install -y ruby-dev
    - gem install dpl

stages:
  #   - test
  - develop
  - staging
  - production

develop:
  type: deploy
  stage: develop
  image: ruby:latest
  script:
    - dpl --provider=heroku --api-key=$HEROKU_API_KEY --app=$HEROKU_APP_DEV
  only:
    - develop

staging:
  type: deploy
  stage: staging
  image: ruby:latest
  script:
    - dpl --provider=heroku --api-key=$HEROKU_API_KEY --app=$HEROKU_APP_STAGING
  only:
    - staging

main:
  type: deploy
  stage: production
  image: ruby:latest
  script:
    - dpl --provider=heroku --api-key=$HEROKU_API_KEY --app=$HEROKU_APP_PRODUCTION
  only:
    - main

  • Looking in the issue I landed on this repo, that has the exact message error. Any hint on the fix?

Thanks for taking the time to be thorough in your request, it really helps! :blush:

Hi @DaveJuel

If you don’t have any other jobs in your CI config, you don’t need image: node:latest at the top of the file, because you’ve specified an image in all of your job definitions.

I have some similar configs to this, which seem to work. I haven’t had time to test anything, but I notice that when you install ruby-dev with apt-get, I’ve also installed git.

HTH

Hi @DaveJuel

Retry using in before-script add the following : - gem install faraday -v 1.8.0 and in the stages add image: ruby:2.7.5

apparently the problem is caused by a version incompatibility between ruby ​​and faraday

2 Likes