markdown 如何解决Rails(OSX)中的OpenSSL错误?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 如何解决Rails(OSX)中的OpenSSL错误?相关的知识,希望对你有一定的参考价值。

How this fix OpenSSL error in Rails (OSX)?

To be more specific, this errors:

```
OpenSSL::SSL::SSLError in XxxController#action
SSL_connect returned=1 errno=0 state=error: certificate verify failed
```

![](http://i.imgur.com/CM7d8AT.jpg)

**How to fix?**

If you need install [wget](http://brewformulas.org/Wget) first.

```
$ cd /usr/local/etc/openssl/certs/
$ wget https://curl.haxx.se/ca/cacert.pem
$ nano ~/.zshrc
```

Add this line into the `.zshrc` file:

```
export SSL_CERT_FILE=/usr/local/etc/openssl/certs/cacert.pem
```

And, run this command:

```
$ source ~/.zshrc
```

**Note**

If you don't have `.zshrc` file, use `.bash_profile` file. I'm using [Z Shell](https://en.wikipedia.org/wiki/Z_shell) - that's why I have `.zshrc` file.

以上是关于markdown 如何解决Rails(OSX)中的OpenSSL错误?的主要内容,如果未能解决你的问题,请参考以下文章

markdown 如何在Mac OSX中重命名文件?

markdown 如何在OSX上安装Dia(并让它运行)

markdown 如何生成Ruby SecureRandom HEX并复制到剪贴板(OSX)?

markdown Rails中的分页

markdown Rails中的多态性

markdown 如何在OSX(Wine)上更新MTG Arena而无需重新下载所有内容