Fix 10.9 ruby framework detection

On Mavericks the ruby headers have been moved into Xcode and it is using
ruby 2.0 so we need to properly set RUBY_VERSION at compile time and
point configure to the proper ruby binary. It also avoids testing for
ruby headers using mkmf, because it will fail on 10.9 due to relocated
headers.

This has been tested for backwards compatibility with 10.6 and 10.7.