NoMethodError: undefined method `loopback?' for #25

xanview opened this Issue Sep 13, 2012 · 4 comments


None yet

6 participants

xanview commented Sep 13, 2012

I'm trying to check if my IP is a loopback ip, I get this:

ip = IPAddress('').loopback?
NoMethodError: undefined method `loopback?' for
    from (irb):9
    from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
    from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
    from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

Any ideas?


It is not implemented. The IPv6 equivalent doesn't seem completely valid either :

=> false

=> false
@mikemackintosh mikemackintosh self-assigned this Mar 26, 2015
tisba commented Jan 4, 2016

My current workaround is to check if a given IP address is included in (I only need v4 currently). Would be a nice addition to the gem's feature set!


It'd be easy enough to include this in a PR but when is 1.0 coming out. I would imagine most are hesitant to contribute changes that would get clobbered by a major release.

bluemonk commented Jan 5, 2016

This was fixed by Mike in f562a7f7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment