In an attempt to learn about Ruby execution methods, I found this blog post on five ways to run commands in Ruby http://mentalized.net/journal/2010/03/08/5_ways_to_run_commands_from_ruby/
The author creates an err.rb file that prints two lines: one on STDOUT, the other on STDERR
#!/usr/bin/env ruby puts "out" STDERR.puts "error"
The first way he tries to launch it is with Kernal # `(backticks)
>> `./err.rb` err => "out\n"
The point that illustrates this is that when you start with reverse loops
STDERR is output, but not captured STDOUT is captured
When I tried to duplicate this on my system, I got a permission error
localhost:sites mike$ `./err.rb` -bash: ./err.rb: Permission denied
I tried sudo ./err.rb unchanged.
I can run ruby err.rb , but this gives a different result than the one received by the author. Namely, by running ruby ββerr.rb, I get
out error
Can someone explain why I get a permission error while trying to run it with reverse windows, and also, as a rule, the goal is to run it with reverse steps.
source share