Improve ruby_installed check