Because the brew binary still uses ruby 1.8 which RUBY_PATH is derived from, so configure would detect ruby version 1.8 while compiling against the Ruby 2.0 framework, which would fail.

Another approach would be to adjust configure to compile against the Ruby framework matching the ruby-command but I don't see the value of using an outdated framework.