Error while following GKE tutorial to run rails on GKE

4/13/2021

While following https://cloud.google.com/solutions/migrating-ruby-on-rails-apps-on-heroku-to-gke I get the error:

"/usr/local/lib/ruby/2.6.0/rubygems.rb:283:in find_spec_for_exe': Could not find 'bundler' (2.2.15) required by your /usr/src/app/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.2.15`
        from /usr/local/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
        from /usr/local/bin/bundle:23:in `<main>'"

when I try to run: docker build -t ruby-app .

Anybody know what's wrong?

-- Richard Teeuwen
docker
google-kubernetes-engine
kubernetes
ruby-on-rails

1 Answer

4/14/2021

Adding the line

RUN gem install bundler

in the Dockerfile before the line

RUN bundle install

did the trick.

-- Richard Teeuwen
Source: StackOverflow