This unfortunately doesn't work with any Ruby earlier than 1.9, because `with_index` is a Ruby 1.9+ feature.  The right approach here is to do this:

```ruby
index[:keys].each_with_index.collect do |(key, index)|
```