当我运行以下命令时,我试图在我的Linux系统上安装一个Ruby项目:
bundle install --jobs=$(nproc) --retry=5我发现了一个错误:

这是上面命令的全部输出:
Fetching source index from https://enterprise.contribsys.com/
Retrying fetcher due to error (2/6): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://enterprise.contribsys.com/.
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 https://railsapps.github.io/openssl-certificate-verify-failed.html. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Retrying fetcher due to error (3/6): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://enterprise.contribsys.com/.
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 https://railsapps.github.io/openssl-certificate-verify-failed.html. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Retrying fetcher due to error (4/6): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://enterprise.contribsys.com/.
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 https://railsapps.github.io/openssl-certificate-verify-failed.html. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Retrying fetcher due to error (5/6): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://enterprise.contribsys.com/.
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 https://railsapps.github.io/openssl-certificate-verify-failed.html. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Retrying fetcher due to error (6/6): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://enterprise.contribsys.com/.
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 https://railsapps.github.io/openssl-certificate-verify-failed.html. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Could not verify the SSL certificate for https://enterprise.contribsys.com/.
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 https://railsapps.github.io/openssl-certificate-verify-failed.html. To connect
without using SSL, edit your Gemfile sources and change 'https' to 'http'.在我的Gemfile中,我试图从https切换到http,但仍然存在相同的问题。
我一直在寻找答案,我发现这是一个与openssl和rvm如何管理它有关的问题,也是一个ca证书问题。
因此,我的问题是:是否有一种方法可以将捆绑安装与特定的openssl版本一起使用?
举个例子,如果我想安装一个不同的Ruby版本,我使用以下命令:
rvm install 2.7.6 --with-openssl-dir=$HOME/.rvm/usr --autolibs=disable有什么提示如何克服这个错误吗?
发布于 2022-08-08 21:54:21
我找到的解决方案是切换到rbenv,之后,所有的问题都解决了。
https://stackoverflow.com/questions/73254577
复制相似问题