gem 插件安装失败

<div class="language-sh highlighter-rouge">
<pre class="highlight">ERROR: Could not find a valid gem <span class="s1">'jekyll-assets'</span> <span class="o">(</span>><span class="o">=</span> 0<span class="o">)</span>, here is why:

      Unable to download data from https://rubygems.org/ - SSL_connect <span class="nv">returned</span><span class="o">=</span>1 <span class="nv">errno</span><span class="o">=</span>0 <span class="nv">state</span><span class="o">=</span>SSLv3 <span class="nb">read </span>server certificate B: certificate verify failed <span class="o">(</span>https://api.rubygems.org/specs.4.8.gz<span class="o">)</span>

</pre>
</div>
通过提示可知,是无法通过 SSL 安全链接导致联网失败。

解决方法:

1.列出当前下载源路径
<div class="language-sh highlighter-rouge">
<pre class="highlight"><span class="gp">$ </span>gem <span class="nb">source</span>
</pre>
</div>
2.删除当前下载源路径
<div class="language-sh highlighter-rouge">
<pre class="highlight"><span class="gp">$ </span>gem <span class="nb">source</span> -r https://rubygems.org/
<span class="c"># 注意路径名称要与列出名称一致</span>
</pre>
</div>
3.新增下载源
<div class="language-sh highlighter-rouge">
<pre class="highlight"><span class="gp">$ </span>gem <span class="nb">source</span> -a http://rubygems.org/
<span class="c"># 主要把 https 换成 http</span>
<span class="c"># 或使用 http://ruby.taobao.org/</span>
</pre>
</div>

赞(0) 打赏
取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

    暂无评论...