【发布时间】:2019-10-05 05:04:40
【问题描述】:
不确定问题是否特定于 concurrent-ruby,但 require 无法按预期工作。我有点不知道如何调试它。当在 Ubuntu 上作为 Docker 之外的普通用户运行时,它可以工作。不幸的是,无法在 Docker 中跟踪进程以查看它的分歧点。有什么想法吗?
更新:问题似乎与 --path ./vendor/bundle 选项有关 - 没有它它可以工作,但不能使用它。
FROM alpine:3.10.2
RUN apk add bash
SHELL ["/bin/bash", "-c"]
RUN apk add npm ruby-bundler
RUN mkdir /app
WORKDIR /app
RUN echo -e "source 'https://rubygems.org'\n\
gem 'concurrent-ruby', require: 'concurrent'\n" >> ./Gemfile
RUN bundle install --path ./vendor/bundle
RUN ruby -e 'require("concurrent")'
输出:
Step 9/9 : RUN ruby -e 'require("concurrent")'
---> Running in efbb0ed5794f
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- concurrent (LoadError)
from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
from -e:1:in `<main>'
The command '/bin/bash -c ruby -e 'require("concurrent")'' returned a non-zero code: 1
【问题讨论】:
-
反对者愿意解释吗?是不清楚我在问什么?关于如何重现问题的详细信息是否不足?问题不属于 SO 而是属于不同的 SE 站点?请告诉我缺少什么。