首页 > 解决方案 > Jelastic CMD /入口点中的bundle exec puma错误

问题描述

我有一个包含 Ruby on Rails 应用程序并使用 Puma 服务器的 docker 映像。

我遇到以下问题...

当我使用CMD / 入口点中的bundle exec puma命令 在Jelastic中部署图像时,run.log 文件向我显示以下错误:

bundler error: command not found: puma 
Install missing gem executables with bundle install

但是,如果我通过 ssh 连接到 docker 容器并执行完全相同的命令bundle exec puma(没有exec bundle install),puma 服务器将正确启动。

在 Gemfile 文件和 Gemfile.lock 我有 puma gem。

Dockerfile:

FROM ruby:2.7.1
WORKDIR /root/app
##### throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1
RUN apt-get update -qq && apt-get install -y nodejs postgresql-client
COPY Gemfile Gemfile.lock ./
RUN bundle config set deployment 'true'
RUN bundle config set path 'vendor/bundle'
RUN bundle config set without 'development:test'
RUN bundle install -j4
COPY . .
RUN rake assets:precompile
CMD sh bin/web

垃圾箱/网络:

bundle exec puma

有什么建议么?

谢谢

标签: ruby-on-railsrubydockerbundlejelastic

解决方案


推荐阅读