CentOS更新ruby版本
安装redis启动集群时发现这样的报错,
./redis-trib.rb create 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7001 127.0.0.1:7002
Creating cluster
Connecting to node 127.0.0.1:7000: [ERR] Sorry, can't connect to node 127.0.0.1:7000
1
2
3
2
3
查一些资料大概意思是ruby 和gem 版本太低,安装新版本。
# If you already installed ruby and ruby-devel packages with yum before, remove them first before upgrading Ruby
sudo yum remove ruby ruby-devel
1
# Build and install the latest Ruby from the source as follows
sudo yum groupinstall "Development Tools"
sudo yum install openssl-devel
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz
tar xvfvz ruby-2.1.2.tar.gz
cd ruby-2.1.2
./configure
make
sudo make install
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# Finally, update Rubygems and Bundler
sudo gem update --system
sudo gem install bundler
1
2
2
# If you have any pre-installed gems with an older version of Ruby, update the gems
sudo gem update
1
# To use the installed Ruby/Rubygems, open a new terminal. Then check the version of installed Ruby and Rubygems as follows
ruby --version
rubygems --version
1
2
2
上次更新: 2024/08/11, 01:59:03