You can use the Zimbra SOAP API from Ruby. The API documentation is currently only available as soap.txt from the source ZimbraServer/docs/soap.txt
You'll want to check the latest source, which can be obtained from our perforce server (codes.zimbra.com) or there is a bundle of the src at:
Browse Zimbra Community Builds & Projects Files on SourceForge.net Building Zimbra using Perforce - Zimbra :: Wiki
Looks like there is a command:
<CreateContactRequest [verbose="0|1"]>
<cn [l="{folder-id}"] [t="{tags}"]>
<a>...</a>+
</cn>
</CreateContactRequest>
Also, search these forums to see if anyone has called the Zimbra SOAP API from Ruby. There might be an example...might not be of creating a contact but would be a good start.