由于 SSL 证书而无法完成到 Rails 5 的升级

Ben*_*Ben 6 ruby ssl rubygems ruby-on-rails-5

我已经进行了几个小时的升级,终于真正陷入困境。当我收到典型的Bundler::Fetcher::CertificateFailureError. 经过多次修补后,我想我已经将所有内容升级到最新版本

$ gem -v
2.6.9

$ ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32]

$ bundle -v
Bundler version 1.14.2
Run Code Online (Sandbox Code Playgroud)

在某些时候我改变了我的宝石来源

$ gem sources --remove http://rubygems.org
$ gem sources --add http://rubygems.org
Run Code Online (Sandbox Code Playgroud)

我还将 Gemfile 更改为 http

当我运行“bundle install”时,出现以下错误(注意,我必须手动中断 bit.ly url 才能发布错误内容)

Fetching source index from https://rails-assets.org/

Retrying fetcher due to error (2/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://rails-assets.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 http://bit. ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Retrying fetcher due to error (3/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://rails-assets.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 http://bit. ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Retrying fetcher due to error (4/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://rails-assets.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 http://bit. ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Could not verify the SSL certificate for https://rails-assets.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 http://bit. ly/ruby-ssl. To connect
without using SSL, edit your Gemfile sources and change 'https' to 'http'.
enter code here
Run Code Online (Sandbox Code Playgroud)

所以我又回到了起点。顺便说一句,当我尝试 https: 到我的时,我现在遇到了另一个错误,gem sources但在我解决这个问题后,作为一个不同的问题可能会更好。

小智 7

如果该问题和 bitly 中的指南未能解决问题,您可能需要重新安装。我以前遇到过这种情况,即使在确保我的证书是最新的之后,似乎也没有任何效果;幸运的是,重新安装似乎解决了这个问题。