Follow this process for sourcing with the Twitter API. Getting data using Ruby and the Twitter API
This is how to redirect stdout and stderr in bash
Execute many commands in one line in Linux
Follow this to execute a script in a different directory in Linux.
Follow this process to install Ruby on Ubuntu Linux