2017-01-10 201 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

相關問題