Use Ruby implementation for `which`

In Windows there's no `/dev/null` and it causes error "The System cannot find the path specified". Also in Windows there's no native `which` and it works only because it's included in DevKit.

This Ruby implementation should correctly work for all platforms.