I've noticed this happening if the cursor is inside a string interpolation, e.g. if the cursor was between 'do' and 'stuff': foo = "bar_#{do.stuff}_baz" I just have to remember to move the cursor out of such a place before hitting CMD+R