【问题标题】:Error while following GKE tutorial to run rails on GKE按照 GKE 教程在 GKE 上运行 rails 时出错
【发布时间】:2021-07-08 12:09:18
【问题描述】:

在关注https://cloud.google.com/solutions/migrating-ruby-on-rails-apps-on-heroku-to-gke 时出现错误:

"/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>'"

当我尝试运行时:docker build -t ruby-app .

有人知道怎么回事吗?

【问题讨论】:

  • 您是否已经尝试运行错误消息中建议的命令? bundle update --bundlergem install bundler:2.2.15
  • 是的,我做到了,但无法在控制台中运行它们。将它们添加到 dockerfile 就可以了。请参阅下面的答案。

标签: ruby-on-rails docker kubernetes google-kubernetes-engine


【解决方案1】:

添加行

RUN gem install bundler

在 Dockerfile 前一行

RUN bundle install

成功了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-29
    • 2020-01-17
    • 2021-05-07
    • 2020-03-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多