Require statement not working in ruby from bash-Collection of common programming errors

I’m trying to get ttscoff’s TaskPaper to Markdown ruby script https://gist.github.com/511174 working. However, I use rvm, which seems to present some challenges.

-rjcode is a no-longer needed Unicode flag and -Ku is another encoding flag I can probably ignore.

I found instructions for adding rvm as a function to your script, but the script still errors as soon as it hits require ftools.

What I added is:

#!/usr/bin/env bash
# TaskPaper to Markdown converter
# Usage: tp2md.rb filename.taskpaper > output.md
# Load RVM into a shell session *as a function*


# Load RVM into a shell session *as a function*
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
  # First try to load from a user install
  source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
  # Then try to load from a root install
  source "/usr/local/rvm/scripts/rvm"
else
  printf "ERROR: An RVM installation was not found.\n"
fi

# Configure ruby and gemset
rvm ruby-1.9.2-p290@global

ruby