当前位置: 首页 > article >正文

centos系统redis-dump安装

1. ​Ruby 环境​

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

安装依赖​:

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

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 ResolutionDependencies Resolved============================================================================================================================================================================================Package                                           Arch                                   Version                                             Repository                               Size
============================================================================================================================================================================================
Installing:autoconf                                          noarch                                 2.69-11.el7                                         base                                    701 kautomake                                          noarch                                 1.13.4-3.el7                                        base                                    679 kbison                                             x86_64                                 3.0.4-2.el7                                         base                                    674 kbzip2                                             x86_64                                 1.0.6-13.el7                                        base                                     52 klibffi-devel                                      x86_64                                 3.0.13-19.el7                                       base                                     23 klibtool                                           x86_64                                 2.4.2-22.el7_3                                      base                                    588 klibyaml-devel                                     x86_64                                 0.1.4-11.el7_0                                      base                                     82 ksqlite-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 kopenssl-devel                                     x86_64                                 1:1.0.2k-26.el7_9                                   updates                                 1.5 Mzlib                                              x86_64                                 1.2.7-21.el7_9                                      updates                                  90 kzlib-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 kperl-Test-Harness                                 noarch                                 3.28-3.el7                                          base                                    302 kperl-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 kopenssl                                           x86_64                                 1:1.0.2k-26.el7_9                                   updates                                 494 kopenssl-libs                                      x86_64                                 1:1.0.2k-26.el7_9                                   updates                                 1.2 MTransaction 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 transactionUpdating   : zlib-1.2.7-21.el7_9.x86_64                                                                                                                                              1/25Updating   : 1:openssl-libs-1.0.2k-26.el7_9.x86_64                                                                                                                                   2/25Updating   : libcurl-7.29.0-59.el7_9.2.x86_64                                                                                                                                        3/25Updating   : zlib-devel-1.2.7-21.el7_9.x86_64                                                                                                                                        4/25Installing : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                                                                     5/25Installing : autoconf-2.69-11.el7.noarch                                                                                                                                             6/25Installing : perl-Thread-Queue-3.02-2.el7.noarch                                                                                                                                     7/25Installing : perl-Test-Harness-3.28-3.el7.noarch                                                                                                                                     8/25Installing : automake-1.13.4-3.el7.noarch                                                                                                                                            9/25Installing : libtool-2.4.2-22.el7_3.x86_64                                                                                                                                          10/25Updating   : 1:openssl-devel-1.0.2k-26.el7_9.x86_64                                                                                                                                 11/25Updating   : curl-7.29.0-59.el7_9.2.x86_64                                                                                                                                          12/25Updating   : 1:openssl-1.0.2k-26.el7_9.x86_64                                                                                                                                       13/25Installing : sqlite-devel-3.7.17-8.el7_7.1.x86_64                                                                                                                                   14/25Installing : bison-3.0.4-2.el7.x86_64                                                                                                                                               15/25Installing : bzip2-1.0.6-13.el7.x86_64                                                                                                                                              16/25Installing : libffi-devel-3.0.13-19.el7.x86_64                                                                                                                                      17/25Installing : libyaml-devel-0.1.4-11.el7_0.x86_64                                                                                                                                    18/25Cleanup    : 1:openssl-devel-1.0.2k-25.el7_9.x86_64                                                                                                                                 19/25Cleanup    : 1:openssl-1.0.2k-25.el7_9.x86_64                                                                                                                                       20/25Cleanup    : curl-7.29.0-59.el7_9.1.x86_64                                                                                                                                          21/25Cleanup    : zlib-devel-1.2.7-20.el7_9.x86_64                                                                                                                                       22/25Cleanup    : libcurl-7.29.0-59.el7_9.1.x86_64                                                                                                                                       23/25Cleanup    : 1:openssl-libs-1.0.2k-25.el7_9.x86_64                                                                                                                                  24/25Cleanup    : zlib-1.2.7-20.el7_9.x86_64                                                                                                                                             25/25Verifying  : libyaml-devel-0.1.4-11.el7_0.x86_64                                                                                                                                     1/25Verifying  : libcurl-7.29.0-59.el7_9.2.x86_64                                                                                                                                        2/25Verifying  : libffi-devel-3.0.13-19.el7.x86_64                                                                                                                                       3/25Verifying  : automake-1.13.4-3.el7.noarch                                                                                                                                            4/25Verifying  : zlib-1.2.7-21.el7_9.x86_64                                                                                                                                              5/25Verifying  : 1:openssl-devel-1.0.2k-26.el7_9.x86_64                                                                                                                                  6/25Verifying  : bzip2-1.0.6-13.el7.x86_64                                                                                                                                               7/25Verifying  : perl-Test-Harness-3.28-3.el7.noarch                                                                                                                                     8/25Verifying  : 1:openssl-libs-1.0.2k-26.el7_9.x86_64                                                                                                                                   9/25Verifying  : perl-Thread-Queue-3.02-2.el7.noarch                                                                                                                                    10/25Verifying  : zlib-devel-1.2.7-21.el7_9.x86_64                                                                                                                                       11/25Verifying  : 1:openssl-1.0.2k-26.el7_9.x86_64                                                                                                                                       12/25Verifying  : libtool-2.4.2-22.el7_3.x86_64                                                                                                                                          13/25Verifying  : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                                                                    14/25Verifying  : curl-7.29.0-59.el7_9.2.x86_64                                                                                                                                          15/25Verifying  : bison-3.0.4-2.el7.x86_64                                                                                                                                               16/25Verifying  : sqlite-devel-3.7.17-8.el7_7.1.x86_64                                                                                                                                   17/25Verifying  : autoconf-2.69-11.el7.noarch                                                                                                                                            18/25Verifying  : zlib-devel-1.2.7-20.el7_9.x86_64                                                                                                                                       19/25Verifying  : 1:openssl-1.0.2k-25.el7_9.x86_64                                                                                                                                       20/25Verifying  : 1:openssl-libs-1.0.2k-25.el7_9.x86_64                                                                                                                                  21/25Verifying  : 1:openssl-devel-1.0.2k-25.el7_9.x86_64                                                                                                                                 22/25Verifying  : libcurl-7.29.0-59.el7_9.1.x86_64                                                                                                                                       23/25Verifying  : curl-7.29.0-59.el7_9.1.x86_64                                                                                                                                          24/25Verifying  : zlib-1.2.7-20.el7_9.x86_64                                                                                                                                             25/25Installed: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.el7libtool.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.1Dependency 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.el7Updated: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_9Dependency 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_9Complete!

2. ​导入 RVM 官方 GPG 密钥

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

gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BD
➜  /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 安装:

curl -sSL https://get.rvm.io | bash -s stable
➜  /opt curl -sSL https://get.rvm.io | bash -s stableDownloading 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 serverCould 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 环境(需重启终端或运行)

source /etc/profile.d/rvm.sh

4.安装ruby

rvm install 3.1.2
➜  ~ 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  CurrentDload  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版本

➜  ~ 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]
# 如果有旧版本,强制使用 RVM 管理的 Ruby
rvm use 3.1.2 --default

5.安装redis-dump

➜  ~ 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

➜  ~ 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

➜  ~ 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

➜  ~ 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?  yamlfrom <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
➜ 

修复错误文件

 ~ 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

 ~ 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

➜  ~ redis-dump -v
redis-dump v0.6.1

相关文章:

centos系统redis-dump安装

1. ​Ruby 环境​ Redis-dump 是一个 Ruby 工具&#xff0c;需先安装 Ruby 和 RubyGems。 安装依赖​&#xff1a; sudo yum install -y curl gpg2 gcc-c patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf aut…...

乘最多水的容器 | 算法 | 给定一个整数数组。有n条垂线。找出其中的两条线,使得它们与 x 轴共同构成的容器可以容纳最多的水。

在我们日常生活中&#xff0c;蓄水似乎是一个极为朴素的物理行为&#xff1a;两堵墙之间&#xff0c;注入水&#xff0c;看谁能装得更多。可如果换个角度&#xff0c;从算法的视角去看这个问题&#xff0c;它会变得怎样&#xff1f;你是否意识到&#xff0c;这样一个简单的问题…...

Python项目文件组织与PyCharm实践:打造高效开发环境

# Python项目文件组织与PyCharm实践&#xff1a;打造高效开发环境 在Python编程的世界里&#xff0c;合理组织项目文件是提升代码质量、增强可维护性以及促进团队协作的关键。同时&#xff0c;借助强大的集成开发环境&#xff08;IDE&#xff09;——PyCharm&#xff0c;我们能…...

【Java高阶面经:数据库篇】19、分库分表查询困境:无分库分表键时的高效应对

一、分库分表下的无分片键查询困境 在分布式数据库架构中,分库分表通过分片键(如买家ID)将数据分散存储,显著提升了单表性能和系统扩展性。然而,当业务需要从非分片键维度(如卖家ID)进行查询时,传统架构暴露出以下核心问题: 1.1 跨分片扫描的性能灾难 数据分散性:以…...

spring中的BeanFactoryAware接口详解

一、接口定义与核心作用 BeanFactoryAware 是 Spring 框架提供的一个回调接口&#xff0c;允许 Bean 在初始化阶段获取其所属的 BeanFactory 实例。该接口定义如下&#xff1a; public interface BeanFactoryAware {void setBeanFactory(BeanFactory beanFactory) throws Bea…...

Unity Hub打不开项目一直在加载

Unity Hub打不开项目&#xff0c;一直在加载。 运行环境&#xff1a;win10 解决方法&#xff1a;退还个人许可证&#xff0c;退出UnityHub重新登录后,再次获取个人许可证 Tips&#xff1a; 国内连续超过三天不登陆就需要激活一次。&#xff08;每天登陆一次会自动续时间吗&…...

蓝桥杯19681 01背包

问题描述 有 N 件物品和一个体积为 M 的背包。第 i 个物品的体积为 vi​&#xff0c;价值为 wi​。每件物品只能使用一次。 请问可以通过什么样的方式选择物品&#xff0c;使得物品总体积不超过 M 的情况下总价值最大&#xff0c;输出这个最大价值即可。 输入格式 第一行输…...

服务器操作系统调优内核参数(方便查询)

fs.aio-max-nr1048576 #此参数限制并发未完成的异步请求数目&#xff0c;应该设置避免I/O子系统故障 fs.file-max1048575 #该参数决定了系统中所允许的文件句柄最大数目&#xff0c;文件句柄设置代表linux系统中可以打开的文件的数量 fs.inotify.max_user_watches8192000 #表…...

ElasticSearch导读

ElasticSearch 简介&#xff1a;ElasticSearch简称ES是一个开源的分布式搜素和数据分析引擎。是使用Java开发并且是当前最流行的开源的企业级搜索引擎&#xff0c;能够达到近实时搜索&#xff0c;它专门设计用于处理大规模的文本数据和实现高性能的全文搜索。它基于 Apache Luc…...

【机器学习】 关于外插修正随机梯度方法的数值实验

1. 随机梯度下降&#xff08;SGD&#xff09; 迭代格式&#xff1a; x k 1 x k − η k ∇ f i ( x k ) x_{k1} x_k - \eta_k \nabla f_i(x_k) xk1​xk​−ηk​∇fi​(xk​) 其中&#xff0c; η k \eta_k ηk​ 为步长&#xff08;可能递减&#xff09;&#xff0c; ∇ f…...

结构型:组合模式

目录 1、核心思想 2、实现方式 2.1 模式结构 2.2 实现案例 3、优缺点分析 4、适用场景 1、核心思想 目的&#xff1a;将总是在重复、迭代地显示的某种自相似性的结构&#xff08;部分与整体结构特征相似&#xff09;&#xff0c;例如树形结构&#xff0c;以统一的方式处…...

windows 删除文件夹提示“操作无法完成,因为其中的文件夹或文件已在另一程序中打开”

windows 删除文件夹提示“操作无法完成&#xff0c;因为其中的文件夹或文件已在另一程序中打开” tomact已经关闭了&#xff0c;刚开始怀疑是tomcat关闭不彻底&#xff0c;但是任务管理器–》进程里根本没有java的进程了&#xff0c;由于是医院服务器、不方便重启 解决方法&am…...

使用 electron-builder 打包与发布 Electron 应用

基于 electron-vite-vue 项目结构 本文将基于 electron-vite-vue 脚手架&#xff0c;详细介绍如何使用 electron-builder 实现&#xff1a; ✅ 多平台打包&#xff08;Windows / macOS / Linux&#xff09;✅ 自动更新发布配置✅ 常用构建脚本与输出结构 &#x1f4c1; 项目结…...

微信小程序中,解决lottie动画在真机不显示的问题

api部分 export function getRainInfo() {return onlineRequest({url: /ball/recruit/getRainInfo,method: get}); }data存储json数据 data&#xff1a;{rainJson:{} }onLoad方法获取json数据 onLoad(options) {let that thisgetRainInfo().then((res)>{that.setData({r…...

Wireshark 抓包工具使用

1.下载地址 https://2.na.dl.wireshark.org/win64/ 或者 Wireshark Go Deep 2.安装并打开 3.电脑设置热点&#xff0c;手机连接热点 4.手机发起网络请求&#xff0c;工具上选择WLAN。或者本地连接 5.点击查看抓包数据&#xff0c;过滤。最好用发送端ip过滤&#xff0c;s…...

大语言模型(LLM)本身是无状态的,怎么固化记忆

大语言模型(LLM)本身是无状态的,无法直接“记住”历史对话或用户特定信息 大语言模型(LLM)本身是无状态的,无法直接“记住”历史对话或用户特定信息,但可以通过架构改进、外部记忆整合、训练方法优化等方案实现上下文记忆能力。 一、模型内部记忆增强:让LLM“记住”…...

JUC入门(六)

12、四大函数式接口 Consumer<T>&#xff08;消费者接口&#xff09; 源码 功能 接收一个参数T&#xff0c;不返回任何结果。主要用于消费操作&#xff0c;例如打印日志、更新状态等。 使用场景 遍历集合并执行操作。 对象的字段赋值。 代码示例 import java.util.…...

std::chrono类的简单使用实例及分析

author: hjjdebug date: 2025年 05月 20日 星期二 14:36:17 CST descrip: std::chrono类的简单使用实例及分析 文章目录 1.实例代码:2. 代码分析:2.1 auto t1 std::chrono::high_resolution_clock::now();2.1.1 什么是 system_clock2.1.2 什么是 chrono::time_point?2.1.3 什…...

Git命令汇总(自用,持续更新update 5/23)

文章目录 Git常见命令1. 推送空提交2. 提交Clean-PR3. 回退add操作4. 交互式rebase4.1 切换模式4.2 保存与退出4.3 注意Rebase 5. 合并多个commit 问题一&#xff1a;Clone Github报错The TLS connection was non-properly terminated.TLS握手报错原因解决 问题二&#xff1a;F…...

window xampp apache使用腾讯云ssl证书配置https

下载腾讯云ssl证书&#xff1a; 编辑Apache根目录下 conf/httpd.conf 文件&#xff1a; #LoadModule ssl_module modules/mod_ssl.so和#Include conf/extra/httpd-ssl.conf&#xff0c;去掉前面的#号注释。 编辑Apache根目录下 conf/httpd-ssl.conf 文件&#xff1a; <Vi…...

MATLAB求解二元一次方程组基础教程

MATLAB求解二元一次方程组基础教程 一、二元一次方程组简介 二元一次方程组是包含两个未知数(x和y)的一组方程&#xff0c;每个方程中未知数的最高次数为1。一般形式为&#xff1a; a₁x b₁y c₁ a₂x b₂y c₂其中a₁, b₁, c₁, a₂, b₂, c₂为已知系数。 二、MATL…...

Android13 wifi设置国家码详解

Android13 wifi设置国家码详解 文章目录 Android13 wifi设置国家码详解一、前言二、设置wifi国家码相关代码1、adb或者串口也能设置和获取当前国家码&#xff08;1&#xff09;查询命令的方式&#xff08;2&#xff09;获取和设置国家码的示例 2、Java代码设置国家码3、获取当前…...

逆向音乐APP:Python爬虫获取音乐榜单 (1)

1. 引言 在数字音乐时代&#xff0c;许多平台如音乐有榜单&#xff0c;限制非付费用户访问高音质或独家内容。然而&#xff0c;从技术研究的角度来看&#xff0c;我们可以通过逆向工程和Python爬虫技术解音乐的API接口&#xff0c;获取付费音乐的播放链接。 2. 技术准备 在当…...

JVM 垃圾回收器

以下是对主流 JVM 垃圾回收器的详细解析&#xff0c;涵盖 一、Serial GC&#xff08;单线程串行回收器&#xff09; 二、Parallel GC&#xff08;吞吐量优先回收器&#xff09; 三、CMS&#xff08;Concurrent Mark Sweep&#xff0c;低延迟回收器&#xff09; 四、G1&…...

Java合并两个列表到目标列表,并且进行排序

可以通过使用addAll()方法将两个列表合并到目标列表中。以下是实现代码&#xff1a; java 复制 下载 List<LedgerRecord> rkRecordList warehouseMapper.selectLedgerRkRecordByMaterialNo(materialNo); List<LedgerRecord> ckRecordList warehouseMapper.se…...

Spring AI Alibaba集成阿里云百炼大模型应用

文章目录 1.准备工作2.引入maven依赖3.application.yml4.调用4.1.非流式调用4.2.流式调用 阿里云百炼推出的智能体应用、工作流应用和智能体编排应用&#xff0c;有效解决了大模型在处理私有领域问题、获取最新信息、遵循固定流程以及自动规划复杂项目等方面的局限&#xff0c;…...

22. 用例依赖装饰器的实现思路和方法

22. 用例依赖装饰器的实现思路和方法 一、核心功能解析 1.1 实现目标 depend(casetest_login) # 当test_login失败时跳过当前测试 def test_order(self):pass功能特性&#xff1a; 前置依赖检测自动跳过失效用例异常依赖关系校验实时结果分析 二、代码逐行解析 2.1 自定义…...

支持向量存储:PostgresSQL及pgvector扩展详细安装步骤!老工程接入RAG功能必备!

之前文章和大家分享过&#xff0c;将会出一篇专栏&#xff08;从电脑装ubuntu系统&#xff0c;到安装ubuntu的常用基础软件&#xff1a;jdk、python、node、nginx、maven、supervisor、minio、docker、git、mysql、redis、postgresql、mq、ollama等&#xff09;&#xff0c;目前…...

【部署】如何离线环境创建docker容器执行python命令行程序

回到目录 【部署】如何离线环境创建docker容器执行python命令行程序 本文以 dify_import项目为例&#xff0c;讲解如何在离线服务器上&#xff0c;搭建docker容器环境&#xff0c;执行python命令行程序 1. 一台有互联网的服务器(ubuntu24.04) 1.1. 拉取一个ubuntu的docker镜…...

idea常用配置 properties中文输出乱码

propertis配置中文乱码 源码和编译后的都是中文 程序输入效果 idea配置3处 程序输出效果 自定义注释模板 IDEA 中有以下两种配置模板。 File and Code Templates Live Templates File and Code Templates File and Code Templates 用来配置文件和代码模板&#xff0c;即…...