From: deivid.rodriguez@... Date: 2020-06-11T20:40:18+00:00 Subject: [ruby-core:98748] [Ruby master Feature#16952] Kernel.exec gives an incorrect error message when passed a script with a non-existing shebang Issue #16952 has been updated by deivid (David Rodr�guez). In my opinion, the error message I'm being given is a bug, because it's telling me that a file the _does_ exist, doesn't exist. Ruby should double check if the file exists before giving that error message, and if it _does_ exist, give a more generic message that it's not clearly incorrect. ---------------------------------------- Feature #16952: Kernel.exec gives an incorrect error message when passed a script with a non-existing shebang https://bugs.ruby-lang.org/issues/16952#change-86106 * Author: deivid (David Rodr�guez) * Status: Open * Priority: Normal ---------------------------------------- ``` $ cat myscript.rb #!/bad/ruby/shebang puts "Hei!" $ ruby -e 'Kernel.exec("myscript.rb")' Traceback (most recent call last): 1: from -e:1:in `
' -e:1:in `exec': No such file or directory - myscript.rb (Errno::ENOENT) ``` From the error, I understand that the script is not there, but the script is clearly there. I would've expected something more similar to what you get if you try to run the script directly from the shell: ``` $ ./myscript.rb bash: ./myscript.rb: /bad/ruby/shebang: bad interpreter: No such file or directory ``` -- https://bugs.ruby-lang.org/ Unsubscribe: