added check for ruby directory before adding to PATH