【问题标题】:Error after running docker-compose without adding puma在不添加 puma 的情况下运行 docker-compose 后出错
【发布时间】:2017-08-13 07:15:12
【问题描述】:

在运行 docker-compose 之前,我忘记在 Gemfile 中添加 puma。在 docker-compose 下载并构建所有依赖项之后。它提出了一个错误,我在这里引入了块。

app_1        | bundler: command not found: puma
app_1        | Install missing gem executables with `bundle install`
ibuy7_db_backup_1 exited with code 0
ibuy7_app_1 exited with code 127

我应该如何解决这个问题。请帮帮我

【问题讨论】:

  • 发布你的 docker-compose 文件

标签: ruby-on-rails docker-compose bundle-install


【解决方案1】:

我找到了解决办法。我使用了这个命令“docker-compose run app bundle install” 安装 puma 和它安装的接缝但是钢我有同样的错误。 Attaching to ibuy7_db_1, ibuy7_db_backup_1, ibuy7_app_1, ibuy7_nginx_1 app_1 | bundler: command not found: puma app_1 | Install missing gem executables with bundle install ibuy7_db_backup_1 exited with code 0 db_1 | LOG: database system was shut down at 2017-08-13 07:30:28 UTC db_1 | LOG: MultiXact member wraparound protections are now enabled db_1 | LOG: autovacuum launcher started db_1 | LOG: database system is ready to accept connections db_1 | LOG: received smart shutdown request db_1 | LOG: autovacuum launcher shutting down db_1 | LOG: shutting down db_1 | LOG: database system is shut down db_1 | LOG: database system was shut down at 2017-08-13 07:35:16 UTC db_1 | LOG: MultiXact member wraparound protections are now enabled db_1 | LOG: database system is ready to accept connections db_1 | LOG: autovacuum launcher started db_1 | LOG: received smart shutdown request db_1 | LOG: autovacuum launcher shutting down db_1 | LOG: shutting down db_1 | LOG: database system is shut down db_1 | LOG: database system was shut down at 2017-08-13 07:41:30 UTC db_1 | LOG: MultiXact member wraparound protections are now enabled db_1 | LOG: database system is ready to accept connections db_1 | LOG: autovacuum launcher started ibuy7_app_1 exited with code 127 nginx_1 | 2017/08/13 07:44:27 [emerg] 1#1: host not found in upstream "app:3000" in /etc/nginx/conf.d/default.conf:2 nginx_1 | nginx: [emerg] host not found in upstream "app:3000" in /etc/nginx/conf.d/default.conf:2 ibuy7_nginx_1 exited with code 1

【讨论】:

    【解决方案2】:

    如果您的 Dockerfile 没有安装捆绑程序和其他所需文件的命令,那么当您启动容器时,映像将没有这些命令。

    如果您运行 docker-compose run app gem install bundler,那么当该容器停止时,新文件会丢失。

    您可能需要添加 'gem install bundler;捆绑安装;将 exec rails s' 捆绑到您的 docker-compose.yml CMD

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-05-20
      • 2021-06-13
      • 2023-03-09
      • 1970-01-01
      • 2020-08-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多