When I install a ruby gem that contains a binary (eg. fpm) under SCL ruby193, the binary is installed to /opt/rh/ruby193/root/usr/local/bin. But this dir is not added to the PATH when "scl enable ruby193 ..." is used. Version-Release number of selected component (if applicable): ruby193-1.1-9.el6.centos.alt.x86_64 How reproducible: sudo yum -y -q install centos-release-SCL sudo yum -y -q install ruby193 ruby193-ruby-devel gcc tar git sudo scl enable ruby193 "gem install --no-ri --no-rdoc fpm" scl enable ruby193 "fpm --version" Actual results: /var/tmp/sclrQHn9S: line 8: fpm: command not found Expected results: 1.3.3 Additional info: The fix is to add /opt/rh/ruby193/root/usr/local/bin to the PATH in /opt/rh/ruby193/enable All the variables in /opt/rh/ruby193/enable should have an equiavelent "local" component added. The modified file might look something like this: export PATH=/opt/rh/ruby193/root/usr/local/bin:/opt/rh/ruby193/root/usr/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/opt/rh/ruby193/root/usr/local/lib64:/opt/rh/ruby193/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} export MANPATH=/opt/rh/ruby193/root/usr/local/share/man:/opt/rh/ruby193/root/usr/share/man:${MANPATH} export PKG_CONFIG_PATH=/opt/rh/ruby193/root/usr/local/lib64/pkgconfig:/opt/rh/ruby193/root/usr/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
This perl code munges the original enable script to add the local version of the elements added to each of the variables: perl -e 'while (<>) { if (/^([^=]*=)([^\$]*)(.*)/) { $pre = $1 ; $path = $2 ; $post = $3 ; ($newpath = $path) =~ s/usr/usr\/local/ ; $newpath =~ s/://g ; print "$pre$newpath:$path$post\n" }}' < enable
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2016:1171