All you need to do is log into the appliance and run
gem install for the gem you want to use. Then your automate method requires the gem the same way you would in any other ruby script.
(Note: In a multi-appliance environment you need to install the gem on all the appliances that where the automate role is defined.)
or if you need a specific version of a gem you could use something like this:
gem 'savon', '=1.1.0'
Additional details which may be of interest:
Automate methods run within a
Bundler.with_clean_env block which means it does not restrict the gems that can be loaded to those defined by bundler.
You can read more about
Bundler.with_clean_env here: http://www.rake.build/fascicles/003-clean-environment.html