Use ldd to detect missing libraries on Solaris. Rewrite Ruby string calculation from Shell to Ruby