I can currently redirect stdout to a string variable in ruby/rails by simply running the command in bash and setting the result to my string variable as follows.
val = %x[ #{cmd} ]
where cmd is a string that represents a bash command.
However, this only captures stdout, for I want to capture stderr and set it to a string in ruby -- any ideas?