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错误?的主要内容,如果未能解决你的问题,请参考以下文章