Fixes for empty ruby version

This prevents issues, when ruby configuration specifies --with-ruby-version=''. These are several small nits needed to fix http://bugs.ruby-lang.org/issues/7807