Also, what about the exec does this fix? I'm pretty sure this should work? Perhaps quoting everything:

`exec "$RUBYCMD" "-I$RUBYLIB" ....`