Tried that and for long commands the line number gets pushed around and seems 'part' of the command.

How about:

`odie "Command failed: L#{index+1}:#{brew_cmd}"` 
or
`odie "Command failed at L#{index+1}:#{brew_cmd}"`