Description of problem: When binary extensions are installed under %gem_extdir/lib/ in a software collection that installs under a namespace other than ruby193, it cannot be loaded. How reproducible: Always. Steps to Reproduce: 1. Create a software collection (foo) that installs ruby gems under it's own namespace, eg /opt/rh/foo. The `enable' script shipped with the foo-runtime package updates the GEM_PATH environment variable eg export GEM_PATH=/opt/rh/foo/root/usr/share/gems:`ruby -e "print Gem.path.join(':')"` 2. Create a gem package (foo-rubygem-bar) under this collection that installs a binary extension under %gem_extdir, eg /opt/rh/foo/root/usr/lib64/gems/exts/bar-1/lib/bar.so 3. Enable ruby193 and foobar scls and try to load the gem eg. $ scl enable ruby193 foo irb irb > require 'foo' Actual results: Gem fails to load with an exception that says that the binary extension cannot be found. Expected results: The binary extension and the gem should be loaded. Additional info: Making the extension available under %gem_libdir solves this problem, but it violates the Fedora Ruby packaging guidelines. A temporary workaround is to either keep the extension under %gem_libdir or make a symlink to the extension installed in %gem_extdir in %gem_libdir eg mv %{buildroot}%{gem_libdir}/bar.so %{buildroot}%{gem_extdir}/lib pushd %{buildroot}%{gem_libdir} ln -s %{gem_extdir}/lib/bar.so popd
Thanks for your report. The Ruby support for binary extensions was never designed in a way to support multiple roots, hence the binary extension path is derived from Ruby location. Unfortunately, since your gems are in different SCL root, Ruby has no clue about it. The possible solution might be to take GEM_PATH environment variable during evaluation of binary extension location.
Moving to 1.1.0
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. http://rhn.redhat.com/errata/RHBA-2014-0619.html