2017-01-10 197 views
0

我试图通过运行以下命令建立一个码头工人形象:解决错误:安装mysql2(0.4.5)时发生错误,并且Bundler无法继续。确保`创业板安装mysql2 -v“0.4.5'`

docker build -t user:repository . 

,并不断收到此错误:

An error occurred while installing mysql2 (0.4.5), and Bundler cannot continue. 
Make sure that `gem install mysql2 -v '0.4.5'` succeeds before bundling. 
The command '/bin/sh -c /bin/bash -l -c "gem install bundler && bundle install"' returned a non-zero code: 5 

我已经试过

  1. 创业板安装mysql2 -v“0.4.5'`

    得到一个错误

    错误:无法找到有效的宝石 'mysql2'(= 0.4.5),这是为什么: 无法从https://rubygems.org/下载数据 - 所以SSL_connect返回= 1个错误号= 0状态=读的SSLv3服务器证书B:证书验证失败(https://api.rubygems.org/specs.4.8.gz

this回购和this网站运行的建议下,我得到的错误:

无法找到有效的宝石“C:RubyGems的-最新情况: 2.6.7.gem'(> = 0)在任何存储库中

我被困在这一点上,因为我不知道这个问题源于哪里。任何帮助将非常感激。

当我运行包更新,我得到一个

Could not verify the SSL certificate for https://rubygems.org/. 
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about 
OpenSSL certificates, see. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'. 

回答

0

尝试运行bundle update。我有一个类似的问题,并为我工作......祝你好运!

+0

@ Ronan Lopes我得到一个无法验证https://rubygems.org/的SSL证书。 您有可能遇到中间人攻击,但您的系统很可能没有验证所需的CA证书。有关 OpenSSL证书的信息,请参阅。要在不使用SSL的情况下进行连接,请编辑您的Gemfile来源并将“https”更改为“http”。 – jshaf

0

Dockerfile在这里会很有用,但我们随便拿一个刺。

如果您使用ubuntu,基本安装不包含任何ca证书,因此SSL无法正常工作。尝试安装软件包'ssl'和'ca-certificates'。

+0

获得ssl包我会运行'brew install openssl'?我将如何在Mac上安装这些软件包?我试过安装openssl没有占上风。 – jshaf

+0

如果你在你的容器中运行OSX,我什么都没有。你的容器是基于什么? – user2105103

相关问题