Map IP address space onto a binary tree
Add this line to your application's Gemfile:
gem 'ipaddr-tree'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ipaddr-tree