作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 ruby on rails 的新手,在使用此命令创建我的第一个项目时 rails new n_project
,我收到了这个错误
run bundle install
Fetching source index from https://rubygems.org/
Retrying fetcher due to error (2/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see .... To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Retrying fetcher due to error (3/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see .... To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Retrying fetcher due to error (4/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see .... To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most
likely your system doesn't have the CA certificates needed for verification. For
information about OpenSSL certificates, see ...
我尝试在 Gemfile 中将 https 更改为 http 并仅执行
bundle install
但问题没有解决。而是出现此消息:
Fetching gem metadata from http://rubygems.org/.
Retrying dependency api due to error (2/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://index.rubygems.org/api/v1/dependencies?gems=rails%2Csqlite3%2Cpuma%2Csass-rails%2Cuglifier%2Ccoffee-rails%2Cjquery-rails%2Cturbolinks%2Cjbuilder%2Cbyebug%2Cweb-console%2Ctzinfo-data.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see .... To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Retrying dependency api due to error (3/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://index.rubygems.org/api/v1/dependencies?gems=rails%2Csqlite3%2Cpuma%2Csass-rails%2Cuglifier%2Ccoffee-rails%2Cjquery-rails%2Cturbolinks%2Cjbuilder%2Cbyebug%2Cweb-console%2Ctzinfo-data.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see .... To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Retrying dependency api due to error (4/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://index.rubygems.org/api/v1/dependencies?gems=rails%2Csqlite3%2Cpuma%2Csass-rails%2Cuglifier%2Ccoffee-rails%2Cjquery-rails%2Cturbolinks%2Cjbuilder%2Cbyebug%2Cweb-console%2Ctzinfo-data.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see .... To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
最佳答案
当我在谷歌上搜索同一问题的答案时,您的问题出现了。我刚刚创建了一个新的 rails 项目,它给出了错误。
remove config/initializers/new_framework_defaults_5_1.rb
run bundle install
Fetching source index from https://rubygems.org/
Retrying fetcher due to error (2/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://rubygems.o
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed forormation about OpenSSL certificates, see bitlylink. To connect without using SSL, edit your Gemfile sources and change 'https
Retrying fetcher due to error (3/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://rubygems.o
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed forormation about OpenSSL certificates, see bitlylink. To connect without using SSL, edit your Gemfile sources and change 'https
Retrying fetcher due to error (4/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://rubygems.o
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed forormation about OpenSSL certificates, see bitlylink. To connect without using SSL, edit your Gemfile sources and change 'https
Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most
likely your system doesn't have the CA certificates needed for verification. For
information about OpenSSL certificates, see bitlylink. To connect
without using SSL, edit your Gemfile sources and change 'https' to 'http'.
希望您设法解决了您的问题,但我想我会描述为我解决问题的步骤,以防其他人遇到同样的问题。
source 'https://rubygems.org'
至
source 'http://rubygems.org'
根本没有工作。
curl -Lks 'https://git.io/rg-ssl' | ruby
这只是告诉我我无法通过 SSL 连接,所以不是特别有用。
gem install bundler
ERROR: Could not find a valid gem 'bundler' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=error: certificate verify failed (httppecs.4.8.gz)
由于 SSL 错误,这也失败了。
gem update --system
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
SSL_connect returned=1 errno=0 state=error: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
这也失败了。
Download the .pem file from this link: GlobalSignRootCA.pem
使用实际指南查找
最新链接到证书。我下载证书文件。
gem which rubygems
对我来说,目录是'C:\RailsInstaller\Ruby2.3.3\lib\ruby\2.3.0\rubygems\ssl_certs'
follow the directions at the very top to automatically update RubyGems.
gem update --system
ERROR: Interrupted
Updating rubygems-update
Successfully installed rubygems-update-3.2.15
Parsing documentation for rubygems-update-3.2.15
Installing ri documentation for rubygems-update-3.2.15
这需要永远没有任何用户反馈,所以我打断了终端。但它似乎一直在做一些工作。
bundle install
Fetching source index from https://rubygems.org/
Resolving dependencies...
Could not verify the SSL certificate for
https://rubygems.org/quick/Marshal.4.8/rails-5.1.7.gemspec.rz.
There is a chance you are experiencing a man-in-the-middle attack, but most
likely your system doesn't have the CA certificates needed for verification. For
information about OpenSSL certificates, see a bitly link. To connect
without using SSL, edit your Gemfile sources and change 'https' to 'http'.
但我仍然收到一些 SSL 证书错误。
gem install bundler
Successfully installed bundler-2.2.15
Parsing documentation for bundler-2.2.15
Installing ri documentation for bundler-2.2.15
Done installing documentation for bundler after 21 seconds
1 gem installed
并且捆绑器更新成功。
bundle install
Fetching gem metadata from https://rubygems.org/.............
Resolving dependencies......
Fetching rake 13.0.3
Installing rake 13.0.3
Fetching concurrent-ruby 1.1.8
Installing concurrent-ruby 1.1.8
Fetching i18n 1.8.9
Installing i18n 1.8.9
Fetching minitest 5.14.4
Installing minitest 5.14.4
Using thread_safe 0.3.6
Fetching tzinfo 1.2.9
... and so on
额外:安装给出了一个 sqlite3 错误,已通过此处找到的信息解决。
How do I install SQLite3 while setting up Ruby on Rails?
$ rails server
=> Booting Puma
=> Rails 5.1.7 application starting in development
=> Run `rails server -h` for more startup options
*** SIGUSR2 not implemented, signal based restart unavailable!
*** SIGUSR1 not implemented, signal based restart unavailable!
*** SIGHUP not implemented, signal based logs reopening unavailable!
Puma starting in single mode...
* Version 3.12.6 (ruby 2.3.3-p222), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000
关于ruby-on-rails - Ruby on rails : problem of verifiying the SSL certificate while installing bundle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65437894/
我使用 iTextPdf 对 PDF 进行签名和完整性检查,由 Alfresco 提供支持 这是签名代码: public void signItem(NodeRef itemToSign, Strin
我是 ruby on rails 的新手,在使用此命令创建我的第一个项目时 rails new n_project ,我收到了这个错误 run bundle install Fetching s
我是一名优秀的程序员,十分优秀!