1

在运行 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

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

4

2 回答 2

0

我找到了解决办法。我使用这个命令“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

于 2017-08-13T07:45:24.007 回答
0

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

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

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

于 2018-03-15T23:20:15.173 回答