bjelli
bjelli

Reputation: 10090

Deploy to dokku fails because of ruby-buildpack + bundler?

I'm deploying a rails app to dokku. The Versions are:

when i try to deploy to dokku, the heroku ruby buildpack is used, and I get the following output:

-----> Ruby app detected
-----> Installing bundler 2.2.21
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-3.1.2
-----> Installing dependencies using bundler 2.2.21
       Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
       [330, #<Thread:0x00007fc0e8b43c90 run>, #<NameError: uninitialized constant Gem::Source
       (defined?(@source) && @source) || Gem::Source::Installed.new
       ^

The crazy thing: I have another app with the same configuration where it works:

-----> Ruby app detected
-----> Installing bundler 2.2.21
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-3.1.2
-----> Installing dependencies using bundler 2.2.21
       Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
       Fetching gem metadata from https://rubygems.org/.........

My research so far:

This seems to be the problem described here as an issue with bundler 2.3.7 first described in February 2022. But my buildpack uses bundler 2.2.21, so it should not be affected?

The newest ruby-buildpack from heroku seems to have been released in 2021? Can this be right?

This fixed the problem for one app:

After one successfull install I could also roll back to the old ruby version, before upgrade, and successfully install that.

How? Why? What is going on here?

Now another app that used to work stopped working.

Upvotes: 0

Views: 382

Answers (1)

bjelli
bjelli

Reputation: 10090

Purging the dokku build cache fixed the problem:

dokku repo:purge-cache

correction: this helped for some applications, not for all

Upvotes: 1

Related Questions