在 Windows 10 上,使用新的 Rails 7 应用程序和空的系统测试,当我运行系统测试时:
rails test test/system/empty_test.rb,我收到以下错误:
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/net-protocol-0.1.2/lib/net/protocol.rb:46:in `connect_nonblock': SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate) (OpenSSL::SSL::SSLError)
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/net-protocol-0.1.2/lib/net/protocol.rb:46:in `ssl_socket_connect'
from C:/Ruby30-x64/lib/ruby/3.0.0/net/http.rb:1038:in `connect'
from C:/Ruby30-x64/lib/ruby/3.0.0/net/http.rb:970:in `do_start'
from C:/Ruby30-x64/lib/ruby/3.0.0/net/http.rb:959:in `start'
from C:/Ruby30-x64/lib/ruby/3.0.0/net/http.rb:621:in `start'
from C:/Ruby30-x64/lib/ruby/3.0.0/net/http.rb:496:in `get_response'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webdrivers-5.0.0/lib/webdrivers/network.rb:33:in `get_response'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webdrivers-5.0.0/lib/webdrivers/network.rb:14:in `get'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webdrivers-5.0.0/lib/webdrivers/chromedriver.rb:66:in `latest_point_release'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webdrivers-5.0.0/lib/webdrivers/chromedriver.rb:39:in `block in latest_version'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webdrivers-5.0.0/lib/webdrivers/common.rb:166:in `with_cache'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webdrivers-5.0.0/lib/webdrivers/chromedriver.rb:37:in `latest_version'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webdrivers-5.0.0/lib/webdrivers/common.rb:122:in `download_version'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webdrivers-5.0.0/lib/webdrivers/common.rb:134:in `correct_binary?'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webdrivers-5.0.0/lib/webdrivers/common.rb:91:in `update'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webdrivers-5.0.0/lib/webdrivers/chromedriver.rb:149:in `block in <main>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/actionpack-7.0.1/lib/action_dispatch/system_testing/browser.rb:36:in `preload'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/actionpack-7.0.1/lib/action_dispatch/system_testing/driver.rb:27:in `initialize'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/actionpack-7.0.1/lib/action_dispatch/system_test_case.rb:159:in `new'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/actionpack-7.0.1/lib/action_dispatch/system_test_case.rb:159:in `driven_by'
from G:/webshop/test/application_system_test_case.rb:4:in `<class:ApplicationSystemTestCase>'
from G:/webshop/test/application_system_test_case.rb:3:in `<main>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:28:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:28:in `require'
from G:/webshop/test/system/empty_test.rb:1:in `<main>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:28:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:28:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.1/lib/rails/test_unit/runner.rb:47:in `block in load_tests'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.1/lib/rails/test_unit/runner.rb:47:in `each'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.1/lib/rails/test_unit/runner.rb:47:in `load_tests'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.1/lib/rails/test_unit/runner.rb:40:in `run'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.1/lib/rails/commands/test/test_command.rb:33:in `perform'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.1/lib/rails/command/base.rb:87:in `perform'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.1/lib/rails/command.rb:48:in `invoke'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-7.0.1/lib/rails/commands.rb:18:in `<main>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:28:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.10.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:28:in `require'
from bin/rails:4:in `<main>'
我不确定代码在寻找什么证书,它只是一个新站点,我从 localhost:3000 本地访问它。
这是空系统测试的代码:
require "application_system_test_case"
class EmptyTest < ApplicationSystemTestCase
end
我使用空测试只是为了确保不是测试代码导致了错误。
这是我的问题:
- Rails 系统测试正在寻找哪个证书?
- 我该如何解决?