The second string is concatenated at compile time into
"/usr/bin/ruby test.rb", so you execute ruby with only that one
argument, which is counted as the program name. Therefore ruby
waits script from stdin.
The second string is concatenated at compile time into
"/usr/bin/ruby test.rb", so you execute ruby with only that one
argument, which is counted as the program name. Therefore ruby
waits script from stdin.
The HTTP server shouldn't be waiting for stdin because test.rb never
calls for it. The server isn't returning a value because it isn't being
sent to the server, it's being sent to the shell. If it was waiting for
input from stdin then hitting enter would return an input
value...nil...and it would return as such.
At Mon, 16 Mar 2009 12:59:51 +0900,
Michael Linfield wrote in [ruby-talk:331241]:
> The second string is concatenated at compile time into
> "/usr/bin/ruby test.rb", so you execute ruby with only that one
> argument, which is counted as the program name. Therefore ruby
> waits script from stdin.
The HTTP server shouldn't be waiting for stdin because test.rb never
calls for it.
Correct, but OP's code doesn't any arguments to /usr/bin/ruby.
So ruby expects that the script will be given from stdin.
That is, I meant a bug about string literal concatenation. It
should be: