def setup_language_pack_environment(ruby_layer_path:, gem_layer_path:, bundle_path:, bundle_default_without:)
    if ruby_version.jruby?
      ENV["PATH"] += ":bin"
      ENV["JRUBY_OPTS"] = env('JRUBY_BUILD_OPTS') || env('JRUBY_OPTS')
    end
    setup_ruby_install_env(ruby_layer_path)

    # By default Node can address 1.5GB of memory, a limitation it inherits from
    # the underlying v8 engine. This can occasionally cause issues during frontend
    # builds where memory use can exceed this threshold.
    #
    # This passes an argument to all Node processes during the build, so that they
    # can take advantage of all available memory on the build dynos.
    ENV["NODE_OPTIONS"] ||= "--max_old_space_size=2560"

    # TODO when buildpack-env-args rolls out, we can get rid of
    # ||= and the manual setting below
    default_config_vars.each do |key, value|
      ENV[key] ||= value
    end

    paths = []
    gem_path = "#{gem_layer_path}/#{slug_vendor_base}"
    ENV["GEM_PATH"] = gem_path
    ENV["GEM_HOME"] = gem_path

    ENV["DISABLE_SPRING"] = "1"

    # Rails has a binstub for yarn that doesn't work for all applications
    # we need to ensure that yarn comes before local bin dir for that case
    paths << yarn_preinstall_bin_path if yarn_preinstalled?
    paths << "#{File.expand_path(".")}/bin"

    paths << "#{gem_layer_path}/#{bundler_binstubs_path}" # Binstubs from bundler, eg. vendor/bundle/bin
    paths << "#{gem_layer_path}/#{slug_vendor_base}/bin"  # Binstubs from rubygems, eg. vendor/bundle/ruby/2.6.0/bin
    paths << ENV["PATH"]

    ENV["PATH"] = paths.join(":")

    ENV["BUNDLE_WITHOUT"] = env("BUNDLE_WITHOUT") || bundle_default_without
    if ENV["BUNDLE_WITHOUT"].include?(' ')
      ENV["BUNDLE_WITHOUT"] = ENV["BUNDLE_WITHOUT"].tr(' ', ':')

      warn("Your BUNDLE_WITHOUT contains a space, we are converting it to a colon `:` BUNDLE_WITHOUT=#{ENV["BUNDLE_WITHOUT"]}", inline: true)
    end
    ENV["BUNDLE_PATH"] = bundle_path
    ENV["BUNDLE_BIN"] = bundler_binstubs_path
    ENV["BUNDLE_DEPLOYMENT"] = "1"
  end
sets up the environment variables for the build process