【发布时间】:2021-04-14 00:34:05
【问题描述】:
我正在努力建立一个新的开发环境,但我意识到我面临着一个小障碍。我在生产中使用 Sidekiq Pro,但在开发中我想避免它以防止将许可证传播给其他开发人员。
为此,在我的Gemfile 我有以下内容:
group :production do
source "https://gems.contribsys.com/" do
gem "sidekiq-pro"
end
end
但是,这个确实存在于我的Gemfile.lock 文件中:
sidekiq-pro (5.2.1)
connection_pool (>= 2.2.3)
sidekiq (>= 6.1.0)
所以,当我在 docker build 中调用 bundle install 时,如何防止 bundle install 尝试使用 sidekiq-pro gem?问题是由于需要身份验证而出错:
Step 6/12 : RUN bundle install --without production
---> Running in 0642e1440b33
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Authentication is required for gems.contribsys.com.
Please supply credentials for this source. You can do this by running:
bundle config gems.contribsys.com username:password
The command '/bin/sh -c bundle install --without production' returned a non-zero code: 17
ERROR: Service 'app' failed to build
如您所见,我在 bundle install 参数中指定了 --without production,但没有运气。
【问题讨论】: