it fixes the issue I think there was a error somewhere, but the notification was being obscured by the threading behavior. I made some unrelated changes and after some debugging, it started working again. Sorry I can't be more specific.
How to get piped input to ruby -e on command line?
I think the issue was by ths following , I'm assuming the content of the input files will be different and you will have some logic to determine that. You can actually just read that file input as if it was entered as text by the user and do whatever you need to do with it. Example:
$ ruby test.rb < testfile
Heroku and PostgreSQL command-line using -c/--command to process query with characters that need to be escaped
this one helps. So as the case would have it, A little more fiddling resulted in the answer. When running the command though the standard psql interface, I needed to escape the $ to \$. However, this continued to fail when running:
heroku pg:psql -c "UPDATE users SET encrypted_password = 'hash_with_\$_in_string';"
heroku pg:psql -c "UPDATE users SET encrypted_password = 'hash_with_\\\$_in_string';"
Reading file input with ruby via command line input
this will help Your problems are: The line fileName = gets.chomp is useless. Remove that. file = $stdin.read.strip will not let you terminate the input. Use gets to get user's input from the command line. You are using the wrong quotation “ in your parameter “r” for File.open. You are not closing the file after reading it. It is better to use the block form of File.open to ensure the file is closed after using.
puts "What is the name of the file to read?"
file = gets.chomp