Description of problem: The Ruby executable interpreters the shebang line in a way which prevents use of ruby within a shebang, with the fixed scl for bug 1372700. Version-Release number of selected component (if applicable): seen with all of ruby193/200/22/24 How reproducible: always Steps to Reproduce: $ cat <<EOF > foo > #!/usr/bin/scl enable rh-ruby22 -- ruby > puts 'Hello, Brave New World.' > EOF $ chmod +x foo $ ./foo Actual results: /opt/rh/rh-ruby22/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- uby (LoadError) from /opt/rh/rh-ruby22/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require' Expected results: Hello, Brave New World Additional info: equivalent without scl enable fix, scl enable rh-ruby22 -- ruby < ./foo .. has the same behaviour.
Actually, I can reproduce it on my Fedora without SCL: ~~~ $ cat <<EOF > foo > #!/usr/bin/scl enable rh-ruby22 -- ruby > EOF $ ruby foo /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- uby (LoadError) from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require' ~~~ So this is some misbehavior of Ruby parser it seems :/ $ rpm -q ruby ruby-2.4.1-79.fc27.x86_64
This is still an issue in both Ruby 2.3.8 and 2.4.5, but it's fixed in Ruby 2.5.
Confirmed this works with rh-ruby26 & rh-ruby27 at least - thanks!