Q: Failing to open rails console and run a script I'm trying to open a Rails console and run a ruby script in it. The script works fine till the rails console opens and then nothing happens. Only when I exit the console manually, do I get an error message saying:
-bash: load: command not found

These are the commands I'm using:
source /etc/profile
source /etc/default/<my-app>
cd /usr/share/<my-app>
NO_AUTH=Y bundle exec ruby-flo -S rails console
load '/home/sirish.aditya/test_code.rb'

How do I load the script into the console?

A: You could use this
echo "$(ruby /home/sirish.aditya/test_code.rb)"

As per you requirement, you could even try rails runner or whenever gem.

A: It doesn't work like that. As soon as the rails console is invoked either manually or through a bash script, you are essentially running a separate process which has no visibility into the subsequent statements (ex: load). 
When you quit the rails console then the process of execution comes back to the main process (which is bash) which does not have any idea what load means and is failing.
You should either use rails runner or custom rake task for what you want to achieve.

A: This is working:
cd /usr/share/<my-app>; source /etc/default/<my-app>; 
cat ~/test_code.rb  | NO_AUTH=Y bundle exec ruby-flo -S rails console

