# File lib/phusion_passenger/platform_info/ruby.rb, line 48
        def self.ruby_command
                if in_rvm?
                        name = rvm_ruby_string
                        dir = rvm_path
                        if name && dir
                                filename = "#{dir}/wrappers/#{name}/ruby"
                                if File.exist?(filename)
                                        contents = File.open(filename, 'rb') do |f|
                                                f.read
                                        end
                                        # Old wrapper scripts reference $HOME which causes
                                        # things to blow up when run by a different user.
                                        if contents.include?("$HOME")
                                                filename = nil
                                        end
                                else
                                        filename = nil
                                end
                                if filename
                                        return filename
                                else
                                        STDERR.puts "Your RVM wrapper scripts are too old. Please " +
                                                "update them first by running 'rvm get head && " +
                                                "rvm reload && rvm repair all'."
                                        exit 1
                                end
                        else
                                # Something's wrong with the user's RVM installation.
                                # Raise an error so that the user knows this instead of
                                # having things fail randomly later on.
                                # 'name' is guaranteed to be non-nil because rvm_ruby_string
                                # already raises an exception on error.
                                STDERR.puts "Your RVM installation appears to be broken: the RVM " +
                                        "path cannot be found. Please fix your RVM installation " +
                                        "or contact the RVM developers for support."
                                exit 1
                        end
                else
                        return ruby_executable
                end
        end