I have the following script:
#!/usr/bin/env ruby require \'rubygems\' require \'net/ssh\' Net::SSH.start(\'host1\', \'root\', :password => \"mypassword1\
Im not a ruby programmer, but you could try to concatenate your commands with ; or &&