add SCLo repo to Centos and install ruby 2.2
Add CentOS SCLo Software collections Repository.
[root@dlp ~]#
yum -y install centos-release-scl-rh centos-release-scl
# set [priority=10]
[root@dlp ~]#
sed -i -e "s/\]$/\]\npriority=10/g" /etc/yum.repos.d/CentOS-SCLo-scl.repo
[root@dlp ~]#
sed -i -e "s/\]$/\]\npriority=10/g" /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
# for another way, change to [enabled=0] and use it only when needed
[root@dlp ~]#
sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-SCLo-scl.repo
[root@dlp ~]#
sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
# if [enabled=0], input a command to use the repository
[root@dlp ~]#
yum --enablerepo=centos-sclo-rh install [Package]
[root@dlp ~]#
yum --enablerepo=centos-sclo-sclo install [Package]
[1] | It's possible to install from CentOS SCLo Software Collections. It's OK to install it even if 2.0 is already installed because 2.2 is located on another PATH. |
# install from SCLo
[root@dlp ~]#
yum --enablerepo=centos-sclo-rh -y install rh-ruby22
|
[2] | Packages from Software Collections are installed uder the /opt directory. To use it, Load environment variables like follows. |
# load environment variables
[root@dlp ~]#
scl enable rh-ruby22 bash
[root@dlp ~]#
[root@dlp ~]#
ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
which ruby
/opt/rh/rh-ruby22/root/usr/bin/ruby |
Comments
Post a Comment