fix ip address error catching for ruby 1.9.3

discussion here

http://meta.discourse.org/t/tests-fail-in-rails-3-mode-on-ruby-1-9-3-with-v0-9-7-4/