Francis,

 > This Ruby code will give you the same result:
 > #--------------------------------------------------
 > [snip]
 > #--------------------------------------------------------
 >
 > as this:
 >
 > echo -n "Some Text" | openssl dgst -sha1 -binary | openssl rsautl - 
sign
 > -inkey private.pem | openssl enc -base64

That's perfect, thank you.

I'll now go and dig through RSA::private_encrypt and RSA::sign and  
see how they differ.

Thank you also to Jan and Robert for your helpful comments.

Kind regards,
Andy