extract checking of sudo to separate function, use su -c instead on pclinuxos, update #2808
do not use ruby from current dir if there is nothing to use, fix #2893