gpt4 book ai didi

ruby-on-rails - 创建新 Rails 项目时出现 SSL 错误

转载 作者:太空宇宙 更新时间:2023-11-03 16:05:22 25 4
gpt4 key购买 nike

当我使用 rails new projectname -d mysql 创建一个新的 Rails 项目(在 Windows 上)时,它会创建所有文件,然后在它尝试执行 bundle install 时返回它:

C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/vendor/net/http/pe
rsistent/ssl_reuse.rb:70:in `connect': SSL_connect returned=1 errno=0 state=SSLv
3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/vendo
r/net/http/persistent/ssl_reuse.rb:70:in `block in connect'
from C:/Ruby193/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
from C:/Ruby193/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/vendo
r/net/http/persistent/ssl_reuse.rb:70:in `connect'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:750:in `start'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/vendo
r/net/http/persistent.rb:628:in `start'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/vendo
r/net/http/persistent.rb:570:in `connection_for'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/vendo
r/net/http/persistent.rb:930:in `request'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/fetch
er.rb:195:in `fetch'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/fetch
er.rb:169:in `use_api'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/sourc
e/rubygems.rb:223:in `block in remote_specs'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/sourc
e/rubygems.rb:223:in `select'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/sourc
e/rubygems.rb:223:in `remote_specs'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/sourc
e/rubygems.rb:162:in `fetch_specs'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/sourc
e/rubygems.rb:66:in `specs'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/defin
ition.rb:192:in `block (2 levels) in index'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/defin
ition.rb:189:in `each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/defin
ition.rb:189:in `block in index'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/index
.rb:9:in `build'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/defin
ition.rb:185:in `index'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/defin
ition.rb:179:in `resolve'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/defin
ition.rb:114:in `specs'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/defin
ition.rb:109:in `resolve_remotely!'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/insta
ller.rb:83:in `run'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/insta
ller.rb:14:in `install'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/cli.r
b:247:in `install'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/vendo
r/thor/task.rb:27:in `run'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/vendo
r/thor/invocation.rb:120:in `invoke_task'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/vendo
r/thor.rb:344:in `dispatch'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/vendo
r/thor/base.rb:434:in `start'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/bin/bundle:20:in
`block in <main>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/lib/bundler/frien
dly_errors.rb:4:in `with_friendly_errors'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.3.0/bin/bundle:20:in
`<main>'
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!

我在使用 Ruby 2.0 时遇到了同样的错误,我认为这可能是问题所在,但同样的事情发生在 Ruby 1.9.3(我为此使用的版本)上。

最佳答案

经过一些谷歌搜索后,我找到了一个指南,向您展示了如何添加正确的 SSL 证书文件(结果证明这是问题所在):

https://gist.github.com/fnichol/867550

关于ruby-on-rails - 创建新 Rails 项目时出现 SSL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15142024/

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