Fix 500 error in Ruby 1.9.
Merge pull request #6249 from babatakao/fix_500_in_ruby19

Fix 500 error in Ruby 1.9.