[#98621] Re: Function getlogin_r()'s protoype] — Bertram Scharpf <lists@...>
FYI,
3 messages
2020/06/02
[#98947] [Ruby master Feature#16986] Anonymous Struct literal — ko1@...
Issue #16986 has been reported by ko1 (Koichi Sasada).
66 messages
2020/06/26
[#98962] [Ruby master Bug#16988] Kernel.load loads file from current directory without '.' in path — misharinn@...
Issue #16988 has been reported by TheSmartnik (Nikita Misharin).
5 messages
2020/06/26
[#98969] [Ruby master Feature#16994] Sets: shorthand for frozen sets of symbols / strings — marcandre-ruby-core@...
Issue #16994 has been reported by marcandre (Marc-Andre Lafortune).
7 messages
2020/06/26
[#100117] [Ruby master Feature#16994] Sets: shorthand for frozen sets of symbols / strings
— matz@...
2020/09/25
Issue #16994 has been updated by matz (Yukihiro Matsumoto).
[ruby-core:98747] [Ruby master Feature#16952] Kernel.exec gives an incorrect error message when passed a script with a non-existing shebang
From:
merch-redmine@...
Date:
2020-06-11 20:31:58 UTC
List:
ruby-core #98747
Issue #16952 has been updated by jeremyevans0 (Jeremy Evans).
Backport deleted (2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN)
ruby -v deleted (ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux])
Tracker changed from Bug to Feature
When I run your example in my shell (OpenBSD ksh), I get:
```
$ ./myscript.rb
ksh: ./myscript.rb: No such file or directory
$ ruby -e 'Kernel.exec("myscript.rb")'
Traceback (most recent call last):
1: from -e:1:in `<main>'
-e:1:in `exec': No such file or directory - myscript.rb (Errno::ENOENT)
```
@Eregon is correct, examining the shebang appears to be a bash-specific behavior, not a general behavior. So I don't think this qualifies as a bug in Ruby. It could potentially be a useful feature, though.
----------------------------------------
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-86105
* Author: deivid (David Rodr刕uez)
* 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 `<main>'
-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: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>