centos系统redis-dump安装

1. ​Ruby 环境​

Redis-dump 是一个 Ruby 工具,需先安装 Ruby 和 RubyGems。

安装依赖​:

bash 复制代码
sudo yum install -y curl gpg2 gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison sqlite-devel
bash 复制代码
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base                                                                                                                                                                 | 3.6 kB  00:00:00
epel                                                                                                                                                                 | 4.3 kB  00:00:00
extras                                                                                                                                                               | 2.9 kB  00:00:00
updates                                                                                                                                                              | 2.9 kB  00:00:00
No package gpg2 available.
Package gcc-c++-4.8.5-44.el7.x86_64 already installed and latest version
Package patch-2.7.1-12.el7_7.x86_64 already installed and latest version
Package readline-6.2-11.el7.x86_64 already installed and latest version
Package readline-devel-6.2-11.el7.x86_64 already installed and latest version
Package 1:make-3.82-24.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package autoconf.noarch 0:2.69-11.el7 will be installed
--> Processing Dependency: perl(Data::Dumper) for package: autoconf-2.69-11.el7.noarch
---> Package automake.noarch 0:1.13.4-3.el7 will be installed
--> Processing Dependency: perl(Thread::Queue) for package: automake-1.13.4-3.el7.noarch
--> Processing Dependency: perl(TAP::Parser) for package: automake-1.13.4-3.el7.noarch
---> Package bison.x86_64 0:3.0.4-2.el7 will be installed
---> Package bzip2.x86_64 0:1.0.6-13.el7 will be installed
---> Package curl.x86_64 0:7.29.0-59.el7_9.1 will be updated
---> Package curl.x86_64 0:7.29.0-59.el7_9.2 will be an update
--> Processing Dependency: libcurl = 7.29.0-59.el7_9.2 for package: curl-7.29.0-59.el7_9.2.x86_64
---> Package libffi-devel.x86_64 0:3.0.13-19.el7 will be installed
---> Package libtool.x86_64 0:2.4.2-22.el7_3 will be installed
---> Package libyaml-devel.x86_64 0:0.1.4-11.el7_0 will be installed
---> Package openssl-devel.x86_64 1:1.0.2k-25.el7_9 will be updated
---> Package openssl-devel.x86_64 1:1.0.2k-26.el7_9 will be an update
--> Processing Dependency: openssl-libs(x86-64) = 1:1.0.2k-26.el7_9 for package: 1:openssl-devel-1.0.2k-26.el7_9.x86_64
---> Package sqlite-devel.x86_64 0:3.7.17-8.el7_7.1 will be installed
---> Package zlib.x86_64 0:1.2.7-20.el7_9 will be updated
---> Package zlib.x86_64 0:1.2.7-21.el7_9 will be an update
---> Package zlib-devel.x86_64 0:1.2.7-20.el7_9 will be updated
---> Package zlib-devel.x86_64 0:1.2.7-21.el7_9 will be an update
--> Running transaction check
---> Package libcurl.x86_64 0:7.29.0-59.el7_9.1 will be updated
---> Package libcurl.x86_64 0:7.29.0-59.el7_9.2 will be an update
---> Package openssl-libs.x86_64 1:1.0.2k-25.el7_9 will be updated
--> Processing Dependency: openssl-libs(x86-64) = 1:1.0.2k-25.el7_9 for package: 1:openssl-1.0.2k-25.el7_9.x86_64
---> Package openssl-libs.x86_64 1:1.0.2k-26.el7_9 will be an update
---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed
---> Package perl-Test-Harness.noarch 0:3.28-3.el7 will be installed
---> Package perl-Thread-Queue.noarch 0:3.02-2.el7 will be installed
--> Running transaction check
---> Package openssl.x86_64 1:1.0.2k-25.el7_9 will be updated
---> Package openssl.x86_64 1:1.0.2k-26.el7_9 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================================
 Package                                           Arch                                   Version                                             Repository                               Size
============================================================================================================================================================================================
Installing:
 autoconf                                          noarch                                 2.69-11.el7                                         base                                    701 k
 automake                                          noarch                                 1.13.4-3.el7                                        base                                    679 k
 bison                                             x86_64                                 3.0.4-2.el7                                         base                                    674 k
 bzip2                                             x86_64                                 1.0.6-13.el7                                        base                                     52 k
 libffi-devel                                      x86_64                                 3.0.13-19.el7                                       base                                     23 k
 libtool                                           x86_64                                 2.4.2-22.el7_3                                      base                                    588 k
 libyaml-devel                                     x86_64                                 0.1.4-11.el7_0                                      base                                     82 k
 sqlite-devel                                      x86_64                                 3.7.17-8.el7_7.1                                    base                                    104 k
Updating:
 curl                                              x86_64                                 7.29.0-59.el7_9.2                                   updates                                 271 k
 openssl-devel                                     x86_64                                 1:1.0.2k-26.el7_9                                   updates                                 1.5 M
 zlib                                              x86_64                                 1.2.7-21.el7_9                                      updates                                  90 k
 zlib-devel                                        x86_64                                 1.2.7-21.el7_9                                      updates                                  50 k
Installing for dependencies:
 perl-Data-Dumper                                  x86_64                                 2.145-3.el7                                         base                                     47 k
 perl-Test-Harness                                 noarch                                 3.28-3.el7                                          base                                    302 k
 perl-Thread-Queue                                 noarch                                 3.02-2.el7                                          base                                     17 k
Updating for dependencies:
 libcurl                                           x86_64                                 7.29.0-59.el7_9.2                                   updates                                 223 k
 openssl                                           x86_64                                 1:1.0.2k-26.el7_9                                   updates                                 494 k
 openssl-libs                                      x86_64                                 1:1.0.2k-26.el7_9                                   updates                                 1.2 M

Transaction Summary
============================================================================================================================================================================================
Install  8 Packages (+3 Dependent packages)
Upgrade  4 Packages (+3 Dependent packages)

Total download size: 7.0 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/18): autoconf-2.69-11.el7.noarch.rpm                                                                                                                              | 701 kB  00:00:00
(2/18): automake-1.13.4-3.el7.noarch.rpm                                                                                                                             | 679 kB  00:00:00
(3/18): bison-3.0.4-2.el7.x86_64.rpm                                                                                                                                 | 674 kB  00:00:00
(4/18): bzip2-1.0.6-13.el7.x86_64.rpm                                                                                                                                |  52 kB  00:00:00
(5/18): libffi-devel-3.0.13-19.el7.x86_64.rpm                                                                                                                        |  23 kB  00:00:00
(6/18): libcurl-7.29.0-59.el7_9.2.x86_64.rpm                                                                                                                         | 223 kB  00:00:00
(7/18): curl-7.29.0-59.el7_9.2.x86_64.rpm                                                                                                                            | 271 kB  00:00:00
(8/18): openssl-1.0.2k-26.el7_9.x86_64.rpm                                                                                                                           | 494 kB  00:00:00
(9/18): openssl-devel-1.0.2k-26.el7_9.x86_64.rpm                                                                                                                     | 1.5 MB  00:00:00
(10/18): libtool-2.4.2-22.el7_3.x86_64.rpm                                                                                                                           | 588 kB  00:00:00
(11/18): openssl-libs-1.0.2k-26.el7_9.x86_64.rpm                                                                                                                     | 1.2 MB  00:00:00
(12/18): perl-Data-Dumper-2.145-3.el7.x86_64.rpm                                                                                                                     |  47 kB  00:00:00
(13/18): perl-Test-Harness-3.28-3.el7.noarch.rpm                                                                                                                     | 302 kB  00:00:00
(14/18): perl-Thread-Queue-3.02-2.el7.noarch.rpm                                                                                                                     |  17 kB  00:00:00
(15/18): sqlite-devel-3.7.17-8.el7_7.1.x86_64.rpm                                                                                                                    | 104 kB  00:00:00
(16/18): libyaml-devel-0.1.4-11.el7_0.x86_64.rpm                                                                                                                     |  82 kB  00:00:00
(17/18): zlib-1.2.7-21.el7_9.x86_64.rpm                                                                                                                              |  90 kB  00:00:00
(18/18): zlib-devel-1.2.7-21.el7_9.x86_64.rpm                                                                                                                        |  50 kB  00:00:00
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                        15 MB/s | 7.0 MB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : zlib-1.2.7-21.el7_9.x86_64                                                                                                                                              1/25
  Updating   : 1:openssl-libs-1.0.2k-26.el7_9.x86_64                                                                                                                                   2/25
  Updating   : libcurl-7.29.0-59.el7_9.2.x86_64                                                                                                                                        3/25
  Updating   : zlib-devel-1.2.7-21.el7_9.x86_64                                                                                                                                        4/25
  Installing : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                                                                     5/25
  Installing : autoconf-2.69-11.el7.noarch                                                                                                                                             6/25
  Installing : perl-Thread-Queue-3.02-2.el7.noarch                                                                                                                                     7/25
  Installing : perl-Test-Harness-3.28-3.el7.noarch                                                                                                                                     8/25
  Installing : automake-1.13.4-3.el7.noarch                                                                                                                                            9/25
  Installing : libtool-2.4.2-22.el7_3.x86_64                                                                                                                                          10/25
  Updating   : 1:openssl-devel-1.0.2k-26.el7_9.x86_64                                                                                                                                 11/25
  Updating   : curl-7.29.0-59.el7_9.2.x86_64                                                                                                                                          12/25
  Updating   : 1:openssl-1.0.2k-26.el7_9.x86_64                                                                                                                                       13/25
  Installing : sqlite-devel-3.7.17-8.el7_7.1.x86_64                                                                                                                                   14/25
  Installing : bison-3.0.4-2.el7.x86_64                                                                                                                                               15/25
  Installing : bzip2-1.0.6-13.el7.x86_64                                                                                                                                              16/25
  Installing : libffi-devel-3.0.13-19.el7.x86_64                                                                                                                                      17/25
  Installing : libyaml-devel-0.1.4-11.el7_0.x86_64                                                                                                                                    18/25
  Cleanup    : 1:openssl-devel-1.0.2k-25.el7_9.x86_64                                                                                                                                 19/25
  Cleanup    : 1:openssl-1.0.2k-25.el7_9.x86_64                                                                                                                                       20/25
  Cleanup    : curl-7.29.0-59.el7_9.1.x86_64                                                                                                                                          21/25
  Cleanup    : zlib-devel-1.2.7-20.el7_9.x86_64                                                                                                                                       22/25
  Cleanup    : libcurl-7.29.0-59.el7_9.1.x86_64                                                                                                                                       23/25
  Cleanup    : 1:openssl-libs-1.0.2k-25.el7_9.x86_64                                                                                                                                  24/25
  Cleanup    : zlib-1.2.7-20.el7_9.x86_64                                                                                                                                             25/25
  Verifying  : libyaml-devel-0.1.4-11.el7_0.x86_64                                                                                                                                     1/25
  Verifying  : libcurl-7.29.0-59.el7_9.2.x86_64                                                                                                                                        2/25
  Verifying  : libffi-devel-3.0.13-19.el7.x86_64                                                                                                                                       3/25
  Verifying  : automake-1.13.4-3.el7.noarch                                                                                                                                            4/25
  Verifying  : zlib-1.2.7-21.el7_9.x86_64                                                                                                                                              5/25
  Verifying  : 1:openssl-devel-1.0.2k-26.el7_9.x86_64                                                                                                                                  6/25
  Verifying  : bzip2-1.0.6-13.el7.x86_64                                                                                                                                               7/25
  Verifying  : perl-Test-Harness-3.28-3.el7.noarch                                                                                                                                     8/25
  Verifying  : 1:openssl-libs-1.0.2k-26.el7_9.x86_64                                                                                                                                   9/25
  Verifying  : perl-Thread-Queue-3.02-2.el7.noarch                                                                                                                                    10/25
  Verifying  : zlib-devel-1.2.7-21.el7_9.x86_64                                                                                                                                       11/25
  Verifying  : 1:openssl-1.0.2k-26.el7_9.x86_64                                                                                                                                       12/25
  Verifying  : libtool-2.4.2-22.el7_3.x86_64                                                                                                                                          13/25
  Verifying  : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                                                                    14/25
  Verifying  : curl-7.29.0-59.el7_9.2.x86_64                                                                                                                                          15/25
  Verifying  : bison-3.0.4-2.el7.x86_64                                                                                                                                               16/25
  Verifying  : sqlite-devel-3.7.17-8.el7_7.1.x86_64                                                                                                                                   17/25
  Verifying  : autoconf-2.69-11.el7.noarch                                                                                                                                            18/25
  Verifying  : zlib-devel-1.2.7-20.el7_9.x86_64                                                                                                                                       19/25
  Verifying  : 1:openssl-1.0.2k-25.el7_9.x86_64                                                                                                                                       20/25
  Verifying  : 1:openssl-libs-1.0.2k-25.el7_9.x86_64                                                                                                                                  21/25
  Verifying  : 1:openssl-devel-1.0.2k-25.el7_9.x86_64                                                                                                                                 22/25
  Verifying  : libcurl-7.29.0-59.el7_9.1.x86_64                                                                                                                                       23/25
  Verifying  : curl-7.29.0-59.el7_9.1.x86_64                                                                                                                                          24/25
  Verifying  : zlib-1.2.7-20.el7_9.x86_64                                                                                                                                             25/25

Installed:
  autoconf.noarch 0:2.69-11.el7     automake.noarch 0:1.13.4-3.el7          bison.x86_64 0:3.0.4-2.el7               bzip2.x86_64 0:1.0.6-13.el7   libffi-devel.x86_64 0:3.0.13-19.el7
  libtool.x86_64 0:2.4.2-22.el7_3   libyaml-devel.x86_64 0:0.1.4-11.el7_0   sqlite-devel.x86_64 0:3.7.17-8.el7_7.1

Dependency Installed:
  perl-Data-Dumper.x86_64 0:2.145-3.el7                         perl-Test-Harness.noarch 0:3.28-3.el7                         perl-Thread-Queue.noarch 0:3.02-2.el7

Updated:
  curl.x86_64 0:7.29.0-59.el7_9.2              openssl-devel.x86_64 1:1.0.2k-26.el7_9              zlib.x86_64 0:1.2.7-21.el7_9              zlib-devel.x86_64 0:1.2.7-21.el7_9

Dependency Updated:
  libcurl.x86_64 0:7.29.0-59.el7_9.2                            openssl.x86_64 1:1.0.2k-26.el7_9                            openssl-libs.x86_64 1:1.0.2k-26.el7_9

Complete!

2. ​导入 RVM 官方 GPG 密钥

某些 Ruby Gem 可能需要编译本地扩展,需安装构建工具和依赖库:

bash 复制代码
gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BD
bash 复制代码
➜  /opt gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BD
gpg: directory `/root/.gnupg' created
gpg: new configuration file `/root/.gnupg/gpg.conf' created
gpg: WARNING: options in `/root/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/root/.gnupg/secring.gpg' created
gpg: keyring `/root/.gnupg/pubring.gpg' created
gpg: "7D2BAF1CF37B13E2069D6956105BD0E739499BD" not a key ID: skipping
gpg: no keyserver known (use option --keyserver)
gpg: keyserver receive failed: Syntax error in URI

3. ​安装 RVM

直接通过 RubyGems 安装:

bash 复制代码
curl -sSL https://get.rvm.io | bash -s stable
bash 复制代码
➜  /opt curl -sSL https://get.rvm.io | bash -s stable

Downloading https://github.com/rvm/rvm/archive/1.29.12.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.12/1.29.12.tar.gz.asc
curl: (52) Empty reply from server

Could not download 'https://github.com/rvm/rvm/releases/download/1.29.12/1.29.12.tar.gz.asc'.
  curl returned status '52'.

Creating group 'rvm'
Installing RVM to /usr/local/rvm/
            source /etc/profile
Installation of RVM in /usr/local/rvm/ is almost complete:

  * First you need to add all users that will be using rvm to 'rvm' group,
    and logout - login again, anyone using rvm will be operating with `umask u=rwx,g=rwx,o=rx`.

  * To start using RVM you need to run `source /etc/profile.d/rvm.sh`
    in all your open shell windows, in rare cases you need to reopen all shell windows.
  * Please do NOT forget to add your users to the rvm group.
     The installer no longer auto-adds root or users to the rvm group. Admins must do this.
     Also, please note that group memberships are ONLY evaluated at login time.
     This means that users must log out then back in before group membership takes effect!
Thanks for installing RVM 🙏
Please consider donating to our open collective to help us maintain RVM.

👉  Donate: https://opencollective.com/rvm/donate

加载 RVM 环境(需重启终端或运行)

bash 复制代码
source /etc/profile.d/rvm.sh

4.安装ruby

bash 复制代码
rvm install 3.1.2
bash 复制代码
➜  ~ rvm install 3.1.2
Searching for binary rubies, this might take some time.
No binary rubies available for: centos/7/x86_64/ruby-3.1.2.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for centos.
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-3.1.2, this may take a while depending on your cpu(s)...
ruby-3.1.2 - #downloading ruby-3.1.2, this may take a while depending on your connection...
** Resuming transfer from byte position 9224192
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10.8M  100 10.8M    0     0   100k      0  0:01:50  0:01:50 --:--:-- 1943k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-3.1.2 - #extracting ruby-3.1.2 to /usr/local/rvm/src/ruby-3.1.2 - please wait
ruby-3.1.2 - #configuring - please wait
ruby-3.1.2 - #post-configuration - please wait
ruby-3.1.2 - #compiling - please wait
ruby-3.1.2 - #installing - please wait
ruby-3.1.2 - #making binaries executable - please wait
Installed rubygems 3.3.7 is newer than 3.0.9 provided with installed ruby, skipping installation, use --force to force installation.
ruby-3.1.2 - #gemset created /usr/local/rvm/gems/ruby-3.1.2@global
ruby-3.1.2 - #importing gemset /usr/local/rvm/gemsets/global.gems - please wait
ruby-3.1.2 - #generating global wrappers - please wait
ruby-3.1.2 - #gemset created /usr/local/rvm/gems/ruby-3.1.2
ruby-3.1.2 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-3.1.2 - #generating default wrappers - please wait
ruby-3.1.2 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-3.1.2 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri

验证ruby版本

bash 复制代码
➜  ~ ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
➜  ~ ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
bash 复制代码
# 如果有旧版本,强制使用 RVM 管理的 Ruby
rvm use 3.1.2 --default

5.安装redis-dump

bash 复制代码
➜  ~ redis-dump -v
zsh: command not found: redis-dump
➜  ~ gem install redis-dump
Fetching redis-dump-0.6.1.gem
Successfully installed redis-dump-0.6.1
Parsing documentation for redis-dump-0.6.1
Installing ri documentation for redis-dump-0.6.1
Done installing documentation for redis-dump after 0 seconds
1 gem installed

验证redis-dump

bash 复制代码
➜  ~ redis-dump -v
<internal:/usr/local/rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- redis (LoadError)
        from <internal:/usr/local/rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/local/rvm/gems/ruby-3.1.2/gems/redis-dump-0.6.1/lib/redis/dump.rb:7:in `<top (required)>'
        from <internal:/usr/local/rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/local/rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/local/rvm/gems/ruby-3.1.2/gems/redis-dump-0.6.1/exe/redis-dump:18:in `<top (required)>'
        from /usr/local/rvm/gems/ruby-3.1.2/bin/redis-dump:25:in `load'
        from /usr/local/rvm/gems/ruby-3.1.2/bin/redis-dump:25:in `<main>'
        from /usr/local/rvm/gems/ruby-3.1.2/bin/ruby_executable_hooks:22:in `eval'
        from /usr/local/rvm/gems/ruby-3.1.2/bin/ruby_executable_hooks:22:in `<main>'

安装reids

bash 复制代码
➜  ~ gem install redis
Fetching connection_pool-2.5.3.gem
Fetching redis-client-0.24.0.gem
Fetching redis-5.4.0.gem
Successfully installed connection_pool-2.5.3
Successfully installed redis-client-0.24.0
Successfully installed redis-5.4.0
Parsing documentation for connection_pool-2.5.3
Installing ri documentation for connection_pool-2.5.3
Parsing documentation for redis-client-0.24.0
Installing ri documentation for redis-client-0.24.0
Parsing documentation for redis-5.4.0
Installing ri documentation for redis-5.4.0
Done installing documentation for connection_pool, redis-client, redis after 1 seconds
3 gems installed

安装yajl

bash 复制代码
➜  ~ redis-dump -v
<internal:/usr/local/rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- yajl (LoadError)
Did you mean?  yaml
        from <internal:/usr/local/rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/local/rvm/gems/ruby-3.1.2/gems/redis-dump-0.6.1/lib/redis/dump.rb:8:in `<top (required)>'
        from <internal:/usr/local/rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/local/rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/local/rvm/gems/ruby-3.1.2/gems/redis-dump-0.6.1/exe/redis-dump:18:in `<top (required)>'
        from /usr/local/rvm/gems/ruby-3.1.2/bin/redis-dump:25:in `load'
        from /usr/local/rvm/gems/ruby-3.1.2/bin/redis-dump:25:in `<main>'
        from /usr/local/rvm/gems/ruby-3.1.2/bin/ruby_executable_hooks:22:in `eval'
        from /usr/local/rvm/gems/ruby-3.1.2/bin/ruby_executable_hooks:22:in `<main>'
➜  ~ gem install yajl-ruby
Fetching yajl-ruby-1.4.3.gem
Building native extensions. This could take a while...
Successfully installed yajl-ruby-1.4.3
Parsing documentation for yajl-ruby-1.4.3
Installing ri documentation for yajl-ruby-1.4.3
Done installing documentation for yajl-ruby after 0 seconds
1 gem installed
➜ 

修复错误文件

bash 复制代码
 ~ redis-dump -v
<internal:/usr/local/rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- uri/redis (LoadError)
        from <internal:/usr/local/rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/local/rvm/gems/ruby-3.1.2/gems/redis-dump-0.6.1/lib/redis/dump.rb:11:in `<top (required)>'
        from <internal:/usr/local/rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/usr/local/rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/local/rvm/gems/ruby-3.1.2/gems/redis-dump-0.6.1/exe/redis-dump:18:in `<top (required)>'
        from /usr/local/rvm/gems/ruby-3.1.2/bin/redis-dump:25:in `load'
        from /usr/local/rvm/gems/ruby-3.1.2/bin/redis-dump:25:in `<main>'
        from /usr/local/rvm/gems/ruby-3.1.2/bin/ruby_executable_hooks:22:in `eval'
        from /usr/local/rvm/gems/ruby-3.1.2/bin/ruby_executable_hooks:22:in `<main>'
➜  ~ vim /usr/local/rvm/gems/ruby-3.1.2/gems/redis-dump-0.6.1/lib/redis/dump.rb
➜ 

将require 'uri/redis' 修改位require 'uri'

安装drydock

bash 复制代码
 ~ redis-dump -v
<internal:/usr/local/rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- drydock (LoadError)
        from <internal:/usr/local/rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /usr/local/rvm/gems/ruby-3.1.2/gems/redis-dump-0.6.1/exe/redis-dump:19:in `<top (required)>'
        from /usr/local/rvm/gems/ruby-3.1.2/bin/redis-dump:25:in `load'
        from /usr/local/rvm/gems/ruby-3.1.2/bin/redis-dump:25:in `<main>'
        from /usr/local/rvm/gems/ruby-3.1.2/bin/ruby_executable_hooks:22:in `eval'
        from /usr/local/rvm/gems/ruby-3.1.2/bin/ruby_executable_hooks:22:in `<main>'
➜  ~ gem install drydock
Fetching drydock-0.6.9.gem
Successfully installed drydock-0.6.9
Parsing documentation for drydock-0.6.9
Installing ri documentation for drydock-0.6.9
Done installing documentation for drydock after 0 seconds
1 gem installed

验证redis-dump

bash 复制代码
➜  ~ redis-dump -v
redis-dump v0.6.1
相关推荐
让学习成为一种生活方式几秒前
linux开机原理以及如何开关机-linux023
linux
南棱笑笑生31 分钟前
20250614让NanoPi NEO core开发板在Ubuntu core16.04系统下使用耳机播音测试
linux·运维·ubuntu
陶然同学1 小时前
从零开始:VMware上的Linux与Java开发环境配置
linux·运维·服务器·vmware·虚拟机
阿拉丁的梦1 小时前
ue5的blender4.1groom毛发插件v012安装和使用方法(排除了冲突错误)
linux·运维·服务器
riverz12272 小时前
ARM 和 x86_64是什么关系
linux
qq_243050796 小时前
aflplusplus:开源的模糊测试工具!全参数详细教程!Kali Linux教程!(一)
linux·web安全·网络安全·黑客·渗透测试·模糊测试·kali linux
小慧10247 小时前
2.1话题发布
linux·ros
夜影风8 小时前
Linux系统中自签名HTTPS证书
linux·运维·https
成工小白9 小时前
【Linux】C语言模拟实现shell命令行(程序替换原理)
linux·运维·服务器
福理原乡大王11 小时前
Linux信号详解
linux·运维·服务器·c++·ubuntu·信号处理