This will not work since you are searching for

    sed -ri 'sX/usr/bin/rakeX%{scl_rake}X'

but here I see

    /bin/bash

Otherwise LGTM