ruby: more compile fixes and add missing headers