Actually, looks like you use this twice. So, replace this row with:

```ruby
index_paths = Array(index_paths)
```

It'll wrap it in an array if it's not an array, otherwise leave it alone.