当前位置: 首页 > 知识库问答 >
问题:

Ruby On Rails无法验证SSL证书错误

上官高逸
2023-03-14

我使用RVM在Ubuntu18.04上安装RubyonRails。ruby-v:2.4。0轨道-v:5.1。3.

我试图运行“bundle install”命令,但发现以下错误。请为我提供最好的解决方案。

无法验证https://rails-assets.org/.的SSL证书可能遇到中间人攻击,但很可能您的系统没有验证所需的CA证书。有关OpenSSL证书的信息,请参见bit.ly/ruby-ssl。若要在不使用SSL的情况下进行连接,请编辑您的GM文件源并将https更改为超文本传输协议。

宝石文件

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end



# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.2'
# Use sqlite3 as the database for Active Record
#gem 'sqlite3'
gem 'pg'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
gem 'jquery-turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
gem 'slim'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
gem 'sidekiq'
gem 'sidetiq'
gem 'sinatra', require: nil

gem 'draper'
gem 'simple_form'
gem 'active_interaction'

# gem 'postgres_ext', '~> 0.0.5'
gem 'devise', '> 4.x'
#gem 'devise', git: 'https://github.com/plataformatec/devise.git', branch: 'master'
#gem 'devise', git: 'https://github.com/gogovan/devise.git', branch: 'rails-5.1'
gem 'erubis'
gem 'activeadmin', '~> 1.0.0.pre'
gem 'inherited_resources', git: 'https://github.com/activeadmin/inherited_resources'
gem 'enumerize'
gem 'public_activity'
gem 'validate_url'
gem 'jquery-rails'
gem 'gon'
gem 'paperclip'
gem 'refile', require: 'refile/rails', github: 'refile/refile'
gem 'refile-mini_magick', github: 'refile/refile-mini_magick'
# gem 'aasm'
gem 'aasm', '~> 3.0', '>= 3.0.5'
gem 'normalize_attributes'
gem 'devise-async'
gem 'it'
gem 'recaptcha', require: 'recaptcha/rails'
gem 'refile-s3'
gem 'mime-types'
gem 'pundit', '~> 0.3'
gem 'responders'
gem 'unobtrusive_flash', '>=3'

gem 'omniauth'
gem 'omniauth-facebook'
gem 'omniauth-google-oauth2'
gem 'omniauth-twitter'
# gem 'fb_graph', '~> 2.7', '>= 2.7.17', git: 'https://github.com/nov/fb_graph.git', branch: 'master'
gem 'twitter'
gem 'shareable'
gem 'google-analytics-rails'


gem 'i18n-js'
gem 'foundation-rails'
gem 'nprogress-rails'
#gem 'wiselinks', '~> 1.2', '>= 1.2.1'
# gem 'wiselinks'
gem 'globalize', git: 'https://github.com/globalize/globalize'
gem 'devise-i18n'
gem 'high_voltage'
gem 'js-routes'
gem 'ahoy_matey','1.5.1'
#gem 'streamio-ffmpeg'
gem 'streamio-ffmpeg', '1.0.0'
#gem 'streamio-ffmpeg', '~> 2.0'
gem 'bundler', '>= 1.7.0'
gem 'sass'
gem 'sassc-rails'
#gem "active_model-errors_details"
#gem 'active_model-errors_details', '~> 1.3'
gem 'aws-sdk'
gem 'seedbank'
gem 'fog', require: 'fog/aws'
gem 'carrierwave'
gem 'ransack'
gem 'navigasmic'
gem 'ltree_hierarchy'
gem 'fontcustom'
gem 'memoist'
gem 'execjs'
gem 'therubyracer'
gem 'textacular'
gem 'flutie'
gem 'record_tag_helper', '~> 1.0'
gem 'friendly_id', '~> 5.1'

gem "hiredis", "~> 0.6.0"
gem "redis", ">= 3.2.0", :require => ["redis", "redis/connection/hiredis"]
gem "httpclient"

gem "closure_tree"
gem "bootstrap-sass"
gem "rails_emoji_picker"
# gem 'whenever', '~> 0.9.4'
gem 'elastic_transcoder'
gem 'crono'
gem 'daemons'


group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '~> 2.13'
  gem 'selenium-webdriver'


  gem 'pry-rails'
  gem 'pry-stack_explorer'
  gem 'rubocop'
  gem 'rspec-rails'
  gem 'factory_girl_rails'
  gem 'letter_opener', '~> 1.4.1'
end

source 'https://rails-assets.org' do
  gem 'rails-assets-jquery.tagsinput'
  gem 'rails-assets-video.js', '5.0.0.15'
  gem 'rails-assets-handlebars'
  gem 'rails-assets-jquery.dotdotdot'
  gem 'rails-assets-jsUri'
  gem 'rails-assets-jQuery-Storage-API'
  gem 'rails-assets-garlicjs'
  gem 'rails-assets-blueimp--jQuery-file-upload'
end


group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'

  gem 'capistrano', '~> 3.3.0'
  gem 'capistrano-rails'
  gem 'capistrano3-unicorn'
  gem 'capistrano-rvm'
  gem 'capistrano-sidekiq'


  #gem 'quiet_assets'


  gem 'yard'
  gem 'better_errors'
  gem 'bullet'
  gem 'thin'
  gem 'librarian-chef', require: false
  gem 'pghero'
  gem "airbrussh", require: false

  gem 'irbtools', require: 'irbtools/binding'
  gem 'irbtools-more', require: 'irbtools/binding'

end
group :test do
  gem 'shoulda-matchers'
  gem 'simplecov', require: false
  gem 'rspec-its'
  gem 'db-query-matchers'
  gem 'rspec-collection_matchers'
  gem 'test_after_commit'
  gem 'fakeredis'
  gem 'timecop'
  gem 'fivemat'
end

group :staging, :production do
  gem 'unicorn'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

我还将“https”改为“http”,但它不起作用。

共有1个答案

叶经略
2023-03-14

今天我在我们的一个应用程序上遇到了同样的问题。我们使用的是来自https://rails-assets.org.我们注意到主存储库中也有相同的gem(https://rubygems.org)。解决方案是从GEM文件中删除块。

我认为如果你需要那些宝石,那么你必须等待证书被更新(由网站所有者)或者找到那些宝石的替代来源。

更新:

你可以替换https://rails-assets.org具有http://insecure.rails-assets.org.请记住在修复此问题后切换回httpsendpoint

 类似资料:
  • 当我想要在cPanel上安装证书时,我会看到以下错误: 错误证书验证失败! 已执行/usr/bin/openssl verify-capath/var/cpanel/ssl/installed/cabundles: stdin:CN=example.com 0深度查找时错误20:无法获取本地颁发者证书

  • 问题内容: 我正在尝试通过调用HTTPS REST API 。在开发过程中,我偶然发现以下错误: 因此,我在Google上搜索了一下,并找到了很多可行的解决方案。 使用Jersey客户端的HTTPS https://gist.github.com/outbounder/1069465 如何解决“ java.security.cert.CertificateException:不存在使用者替代名称”

  • 问题内容: 假设我编写了两个Java应用程序:并且它们被部署并在两个单独的服务器上运行(部署到和部署到),并且这两个应用程序需要通过SSL相互通信(双向)。我们还假设每个应用程序都有自己的SSL证书。 我(Java程序员)如何编码并验证彼此的SSL证书?每个CA是否都提供某种我可以使用的RESTful API ?Java是否有自己的证书验证API?我可以使用开放源代码的第三方JAR或服务吗? 当我

  • 我正在尝试通过调用HTTPS REST API。在开发过程中,我偶然发现了以下错误: 所以我用谷歌搜索了一下,找到了大量的解决方案,实际上是有效的。 使用泽西客户端的HTTPS https://gist.github.com/outbounder/1069465 如何修复java.security.cert.证书异常:不存在主题替代名称错误? http://www.mkyong.com/webse

  • 误差 PHP警告:stream_socket_client():SSL操作失败,代码为1。OpenSSL错误消息:错误:14090086:SSL例程:SSL3_GET_Server_Certifice:证书验证失败