ruby: Fix undefined method and directory not empty errors

Fixes #29982

Anyone know why the symlink extension method isn't working?