gpt4 book ai didi

ruby-on-rails - 创建 D :\sites>rails new simple_cms -d mysql 时未安装 Gems

转载 作者:太空宇宙 更新时间:2023-11-03 15:08:28 26 4
gpt4 key购买 nike

我已经安装了 gems,当我输入 gem -v 时一切正常。我有 Windows 10,教室环境,Ruby v 2.2;但是当我运行测试或执行上述命令时,我得到以下信息。

Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies.....

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.global.ssl.fastly.net/gems/rake-11.2.2.gem)
Using i18n 0.7.0

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.global.ssl.fastly.net/gems/json-1.8.3.gem)

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.global.ssl.fastly.net/gems/minitest-5.9.0.gem)
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.global.ssl.fastly.net/gems/mini_portile2-2.1.0.gem)

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.global.ssl.fastly.net/gems/pkg-config-1.1.7.gem)
Using rack 1.6.4

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.global.ssl.fastly.net/gems/mime-types-data-3.2016.0521.gem)
Using arel 6.0.3

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.global.ssl.fastly.net/gems/debug_inspector-0.0.2.gem)
Using bundler 1.11.2

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.global.ssl.fastly.net/gems/byebug-9.0.5.gem)
Using coffee-script-source 1.10.0

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.global.ssl.fastly.net/gems/execjs-2.7.0.gem)
Using thor 0.19.1

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.global.ssl.fastly.net/gems/concurrent-ruby-1.0.2.gem)

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.global.ssl.fastly.net/gems/multi_json-1.12.1.gem)

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.global.ssl.fastly.net/gems/mysql2-0.4.4-x86-mingw32.gem)

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.global.ssl.fastly.net/gems/sass-3.4.22.gem)

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.global.ssl.fastly.net/gems/tilt-2.0.5.gem)

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.global.ssl.fastly.net/gems/turbolinks-source-5.0.0.gem)
An error occurred while installing rake (11.2.2), and Bundler cannot continue.
Make sure that `gem install rake -v '11.2.2'` succeeds before bundling.

最佳答案

请按照以下说明进行操作,这将解决您的问题。

步骤很简单:

Step 1: Obtain the new trust certificate

我们需要下载AddTrustExternalCARoot-2048.pem .

使用上面的链接并将此文件放置/保存到您以后可以轻松找到的地方(例如您的桌面)。

重要提示:文件必须以 .pem 作为扩展名。 Chrome 等浏览器会尝试将其保存为纯文本文件。确保在下载后将文件名更改为包含 .pem。

Step 2: Locate RubyGems certificate directory in your installation

为了让我们复制这个文件,我们需要知道把它放在哪里。

根据安装 Ruby 的位置,目录会有所不同。

以默认安装的Ruby 2.1.5为例,放在C:\Ruby21

打开命令提示符并输入:

C:>gem which ruby​​gemsC:/Ruby21/lib/ruby/2.1.0/rubygems.rb现在,让我们找到那个目录。在同一窗口中,输入文件扩展名之前的路径部分,但使用反斜杠代替:

C:>启动 C:\Ruby21\lib\ruby\2.1.0\rubygems这将在我们指定的目录中打开一个资源管理器窗口。

Step 3: Copy new trust certificate

现在,找到 ssl_certs 目录并复制我们从上一步中获得的 .pem 文件。

它将与其他文件一起列出,例如 GeoTrustGlobalCA.pem。

Step 4: Profit

实际上没有第 4 步。您现在应该可以毫无问题地安装 Ruby gems。

more details on github

关于ruby-on-rails - 创建 D :\sites>rails new simple_cms -d mysql 时未安装 Gems,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38761104/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com