Rails: undefined method ‘[]’ for #<Enumerable::Enumerator>

I was moving an older Rails app to a new server when I encountered this error. This gives a good description of what was going on and shows how to fix it:
Ruby 1.8.7 and acts_as_attachment didn’t get along with each other in my case. However, there’s a typo where .first == ‘/’ is replaced.
starts_with(‘/’) should be starts_with?(‘/’).
That’s no rocket science but could be useful for noobs (on Rails).