Bug 1225496 - gem binaries are installed to <root>/usr/local/bin which is not in the SCL PATH
Summary: gem binaries are installed to <root>/usr/local/bin which is not in the SCL PATH
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Software Collections
Classification: Red Hat
Component: ruby
Version: rh-ruby23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 2.2
Assignee: Pavel Valena
QA Contact: Iveta Wiedermann
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-27 13:48 UTC by Robin Bowes
Modified: 2016-05-31 10:27 UTC (History)
4 users (show)

Fixed In Version: rh-ruby23-2.2-4.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-31 10:27:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2016:1171 0 normal SHIPPED_LIVE new packages: rh-ruby23 2016-05-31 14:11:10 UTC

Description Robin Bowes 2015-05-27 13:48:19 UTC
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}}

Comment 2 Robin Bowes 2015-05-27 14:22:53 UTC
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

Comment 8 errata-xmlrpc 2016-05-31 10:27:14 UTC
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


Note You need to log in before you can comment on or make changes to this bug.