gpt4 book ai didi

ruby - NoMethodError(未定义方法 `slice!' 为 nil :NilClass) from Redis call

转载 作者:可可西里 更新时间:2023-11-01 11:48:36 27 4
gpt4 key购买 nike

我随机收到以下错误消息。有谁知道可能导致这种情况的原因吗?

NoMethodError (undefined method `slice!' for nil:NilClass):
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/connection/ruby.rb:274:in `read'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:248:in `block in read'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:236:in `io'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:247:in `read'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:112:in `block in call'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:217:in `block (2 levels) in process'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:353:in `ensure_connected'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:207:in `block in process'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:292:in `logging'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:206:in `process'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis/client.rb:112:in `call'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis.rb:789:in `block in get'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis.rb:37:in `block in synchronize'
/usr/local/ruby-2.1.5/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis.rb:37:in `synchronize'
vendor/bundle/ruby/2.1.0/gems/redis-3.2.1/lib/redis.rb:788:in `get'
vendor/bundle/ruby/2.1.0/gems/redis-store-1.1.4/lib/redis/store/interface.rb:5:in `get'
vendor/bundle/ruby/2.1.0/gems/redis-store-1.1.4/lib/redis/store/marshalling.rb:17:in `get'
vendor/bundle/ruby/2.1.0/gems/redis-activesupport-4.0.0/lib/active_support/cache/redis_store.rb:169:in `read_entry'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.9/lib/active_support/cache.rb:312:in `block in read'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.9/lib/active_support/cache.rb:548:in `instrument'
vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.9/lib/active_support/cache.rb:311:in `read'
/var/www/apps/13712/shared/vendor_bundle/ruby/2.1.0/bundler/gems/spree-13f1df56d58f/core/app/models/spree/preferences/store.rb:34:in `get'
/var/www/apps/13712/shared/vendor_bundle/ruby/2.1.0/bundler/gems/spree-13f1df56d58f/core/app/models/spree/preferences/scoped_store.rb:13:in `fetch'
/var/www/apps/13712/shared/vendor_bundle/ruby/2.1.0/bundler/gems/spree-13f1df56d58f/core/app/models/spree/preferences/preferable_class_methods.rb:13:in `block in preference'
/var/www/apps/13712/shared/vendor_bundle/ruby/2.1.0/bundler/gems/spree-13f1df56d58f/core/app/models/spree/preferences/preferable.rb:43:in `get_preference'
vendor/bundle/ruby/2.1.0/bundler/gems/spree-13f1df56d58f/core/lib/spree/core/controller_helpers/ssl.rb:8:in `block (2 levels) in <module:SSL>'

last place Spree 在调用 redis-rb 之前被命中:

  unless (val = @cache.read(key)).nil? 
return val
end

哪里 @cache = Rails.cache

更新

我将此 gem 与此 SSL plugin 一起使用,所以错误可能与插件有关。

错误发生在 line = @sock.getsnil 时。这是本地人在确定是真的之后。

[1] pry(#<Redis::Connection::Ruby>)> line
=> nil
[2] pry(#<Redis::Connection::Ruby>)> @sock
=> #<OpenSSL::SSL::SSLSocket:0x007fdab2688730
@callback_state=nil,
@context=
#<OpenSSL::SSL::SSLContext:0x007fdab2688758
@ca_file=nil,
@ca_path=nil,
@cert=nil,
@cert_store=nil,
@client_ca=nil,
@client_cert_cb=nil,
@extra_chain_cert=nil,
@key=nil,
@npn_protocols=nil,
@npn_select_cb=nil,
@options=nil,
@renegotiation_cb=nil,
@servername_cb=nil,
@session_get_cb=nil,
@session_id_context=nil,
@session_new_cb=nil,
@session_remove_cb=nil,
@timeout=nil,
@tmp_dh_callback=nil,
@verify_callback=nil,
@verify_depth=nil,
@verify_mode=nil>,
@eof=true,
@hostname=nil,
@io=#<Redis::Connection::TCPSocket:fd 11>,
@rbuffer="",
@sync=true,
@sync_close=false,
@wbuffer="">
[3] pry(#<Redis::Connection::Ruby>)> @sock.closed?
=> false

最佳答案

这看起来可能是 ruby​​ redis 客户端的问题。

您可以尝试降级版本和/或为 redis 团队提交问题 in the Github repository .

关于ruby - NoMethodError(未定义方法 `slice!' 为 nil :NilClass) from Redis call,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30358664/

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