redis-dump
redis-dump copied to clipboard
Error: uninitialized class variable @@schemes
Just running redis-dump
generates this error for me:
/home/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/uri-redis-0.4.2/lib/uri/redis.rb:93:in `<module:URI>': uninitialized class variable @@schemes in URI (NameError)
Did you mean? scheme_list
from /home/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/uri-redis-0.4.2/lib/uri/redis.rb:4:in `<top (required)>'
from <internal:/home/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/home/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /home/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/redis-dump-0.4.0/lib/redis/dump.rb:6:in `<top (required)>'
from <internal:/home/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/home/vagrant/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /home/vagrant/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/redis-dump-0.4.0/bin/redis-dump:18:in `<top (required)>'
from /home/vagrant/.rbenv/versions/3.1.3/bin/redis-dump:25:in `load'
from /home/vagrant/.rbenv/versions/3.1.3/bin/redis-dump:25:in `<main>'
on Ubuntu 20.04, Ruby 3.1.3
I also have this issue with Ruby 3.2.0. Works with Ruby 3.0.5, though.
Seems like the problem is in the uri-redis gem (also by @delano), which was last updated in 2010, and that there is an open PR that fixes this issue: https://github.com/delano/uri-redis/pull/2
delano/uri-redis#2 is merged and a new (pre-release) is available via github and rubygems:
https://github.com/delano/uri-redis/releases/tag/v1.0.0-RC2 https://rubygems.org/gems/uri-redis/versions/1.0.0.pre.RC2
$ gem install --pre uri-redis
Please let me know here if you have any related issues with this release.
Thanks.
For me, just installing the pre version of uri-redis did not fix it.
But when running bundle exec redis-dump
in a folder with the below Gemfile, it works.
source "https://rubygems.org"
gem "redis-dump"
gem "uri-redis", '1.0.0.pre.RC2'
Ah yeah, that makes sense. Bundler weaves all the explicit dependencies together. Thanks for the follow-up.
I'll push an update to redis-dump today. In the meantime I bumped uri-redis up to 1.0: https://github.com/delano/uri-redis/releases/tag/v1.0.0.
Excellent, thanks.
what are you takiking aboute, so what Should i do?