def install_ruby(install_path: )
    # Could do a compare operation to avoid re-downloading ruby
    return false unless ruby_version

    installer = LanguagePack::Installers::HerokuRubyInstaller.new(
      multi_arch_stacks: MULTI_ARCH_STACKS,
      stack: @stack,
      arch: @arch
    )

    @ruby_download_check = LanguagePack::Helpers::DownloadPresence.new(
      multi_arch_stacks: MULTI_ARCH_STACKS,
      file_name: ruby_version.file_name,
      arch: @arch
    )
    @ruby_download_check.call

    installer.install(ruby_version, install_path)

    @outdated_version_check = LanguagePack::Helpers::OutdatedRubyVersion.new(
      current_ruby_version: ruby_version,
      fetcher: installer.fetcher,
    )
    @outdated_version_check.call

    @metadata.write("buildpack_ruby_version", ruby_version.version_for_download)

    topic "Using Ruby version: #{ruby_version.version_for_download}"
    if ruby_version.default?
      warn(<<~WARNING)
        You have not declared a Ruby version in your Gemfile.

        To declare a Ruby version add this line to your Gemfile:

        ```
        ruby "#{LanguagePack::RubyVersion::DEFAULT_VERSION_NUMBER}"
        ```

        For more information see:
          https://devcenter.heroku.com/articles/ruby-versions
      WARNING
  end

    true
  rescue LanguagePack::Fetcher::FetchError
    if @ruby_download_check.does_not_exist?
      message = <<~ERROR
        The Ruby version you are trying to install does not exist: #{ruby_version.version_for_download}
      ERROR
    else
      message = <<~ERROR
        The Ruby version you are trying to install does not exist on this stack.

        You are trying to install #{ruby_version.version_for_download} on #{stack}.

        Ruby #{ruby_version.version_for_download} is present on the following stacks:

          - #{@ruby_download_check.valid_stack_list.join("\n  - ")}
      ERROR

      if env("CI")
        message << <<~ERROR

          On Heroku CI you can set your stack in the `app.json`. For example:

          ```
          "stack": "heroku-24"
          ```
        ERROR
      end
    end

    message << <<~ERROR

      Heroku recommends you use the latest supported Ruby version listed here:
        https://devcenter.heroku.com/articles/ruby-support#supported-runtimes

      For more information on syntax for declaring a Ruby version see:
        https://devcenter.heroku.com/articles/ruby-versions
    ERROR

    error message
  end
install the vendored ruby
@return [Boolean] true if it installs the vendored ruby and false otherwise