travis-ci / dpl

Dpl (dee-pee-ell) is a deploy tool made for continuous deployment.
MIT License
1.29k stars 367 forks source link

uninitialized constant Rendezvous::StringIO #1264

Open phortx opened 2 years ago

phortx commented 2 years ago
-----> Launching...
 !     Release command declared: this new release will not be available until the command succeeds.
       Released v390
       [...] deployed to Heroku
/root/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rendezvous-0.1.3/lib/rendezvous.rb:44:in `start': uninitialized constant Rendezvous::StringIO (NameError)
      if input.is_a?(StringIO)
                     ^^^^^^^^
    from /root/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rendezvous-0.1.3/lib/rendezvous.rb:28:in `start'
    from /root/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/dpl-heroku-1.10.16/lib/dpl/provider/heroku/generic.rb:86:in `run'
    from /root/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/dpl-1.10.16/lib/dpl/provider.rb:205:in `block (2 levels) in deploy'
    from /root/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/dpl-1.10.16/lib/dpl/cli.rb:41:in `fold'
    from /root/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/dpl-1.10.16/lib/dpl/provider.rb:205:in `block in deploy'
    from /root/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/dpl-1.10.16/lib/dpl/provider.rb:201:in `each'
    from /root/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/dpl-1.10.16/lib/dpl/provider.rb:201:in `deploy'
    from /root/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/dpl-1.10.16/lib/dpl/cli.rb:32:in `run'
    from /root/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/dpl-1.10.16/lib/dpl/cli.rb:7:in `run'
    from /root/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/dpl-1.10.16/bin/dpl:5:in `<top (required)>'
    from /root/.asdf/installs/ruby/3.1.2/bin/dpl:25:in `load'
    from /root/.asdf/installs/ruby/3.1.2/bin/dpl:25:in `<main>'

Also happens without release command. It seems like it trys to parse the url from the heroku result and rendezvous checks for StringIO without explicit requiring StringIO

Any idea?

phortx commented 2 years ago

I've worked around by adding

RUN sed -i '1s/^/require "stringio"\n/' /root/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/rendezvous-0.1.3/lib/rendezvous.rb

to my GitLab CI Docker file which is used for the deployment. However, this feels really dirty :D

ovidiuanca commented 2 years ago

Had the same issue and fixed it after installing gem faraday after installing dpl.

In Gitlab CI:

script:
    - gem install dpl
    - gem install faraday -v 1.8.0
    - dpl --provider=heroku --run ...