You can create the installation file required before the script. Then call ruby with the -r flag:
ruby -r "$HOME/.rubyopts.rb" myscript.rb
You can also set the RUBYOPT environment RUBYOPT to automatically include this file every time ruby starts:
export RUBYOPT="-r $HOME/.rubyopts.rb"
source share