centos7 Ruby环境变量配置

时间:2023-03-09 03:06:02
centos7 Ruby环境变量配置

ruby安装参考博客:https://blog.****.net/yelllowcong/article/details/78362370  (Redis之集群redis-trib.rb环境的搭建-yellowcong)

vi /etc/profile      修改环境变量,添加红色部分:

for i in /etc/profile.d/*.sh /etc/profile.d/sh.local ; do
if [ -r "$i" ]; then
if [ "${-#*i}" != "$-" ]; then
. "$i"
else
. "$i" >/dev/null
fi
fi
done export RUBY_BIN=/usr/local/ruby-2.4.2/bin
export PATH=$PATH:$RUBY_BIN

source /etc/profile       重新生效环境变量