为什么我不能在Mac上安装宝石呢?

时间:2021-02-05 20:40:47

I tried doing gem install for just about any gem and I have been getting errors. I think I need to reset and or update something on my computer but not sure what.

我试着为任何gem安装gem,而且我一直在出错。我想我需要在我的电脑上重置或更新一些东西,但不确定是什么。

Here is some of the command line code errors:

以下是一些命令行代码错误:

ERROR:  Could not find a valid gem 'multi_json' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz)

ERROR:  Could not find a valid gem 'cowsay' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz)

sudo gem install rubygems-update
Password:
ERROR:  Could not find a valid gem 'rubygems-update' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz)

Does anyone know what I need to do to fix this? I got a new computer and was wondering if I need to set up the user differently or something?

有人知道我需要做什么来解决这个问题吗?我买了一台新电脑,想知道是否需要以不同的方式设置用户?

4 个解决方案

#1


49  

I had the same problem and this solution from above user worked for me.

我也遇到了同样的问题,上面那位用户的解决方案对我起了作用。

rvm osx-ssl-certs update all

#2


9  

There seems to be this common issue lately. If you're on a Mac, try doing this if you installed via RVM:

最近似乎有一个共同的问题。如果你在Mac电脑上,如果你是通过RVM安装的话,试试这样做:

rvm osx-ssl-certs update all

#3


6  

Alternatively you can add the insecure ruby source with the following command:

或者,您可以使用以下命令添加不安全的ruby源代码:

sudo gem sources -a http://rubygems.org

#4


5  

For those that arent using rvm, but are using homebrew:

对于那些不使用rvm,但正在使用homebrew的用户:

brew tap raggi/ale
brew install openssl-osx-ca

This worked for me.

这为我工作。

#1


49  

I had the same problem and this solution from above user worked for me.

我也遇到了同样的问题,上面那位用户的解决方案对我起了作用。

rvm osx-ssl-certs update all

#2


9  

There seems to be this common issue lately. If you're on a Mac, try doing this if you installed via RVM:

最近似乎有一个共同的问题。如果你在Mac电脑上,如果你是通过RVM安装的话,试试这样做:

rvm osx-ssl-certs update all

#3


6  

Alternatively you can add the insecure ruby source with the following command:

或者,您可以使用以下命令添加不安全的ruby源代码:

sudo gem sources -a http://rubygems.org

#4


5  

For those that arent using rvm, but are using homebrew:

对于那些不使用rvm,但正在使用homebrew的用户:

brew tap raggi/ale
brew install openssl-osx-ca

This worked for me.

这为我工作。