can this help? otherwise, there is this.
It seems that neartree is a better thing to search for w.r.t. ruby.
Hope this helps!
EDIT: if you need a general purpose implementation of an rtree, maybe the boost (c++) library can help there are bindings for it here. that has bindings for methods which should help your use-case:
intersects?
intersects_each?
intersects_rect?
intersects_rect_each?