def set
      unless buildpack_url = shift_argument
        error("Usage: heroku buildpacks:set BUILDPACK_URL.\nMust specify target buildpack URL.")
      end

      index = get_index(0)

      mutate_buildpacks_constructive(buildpack_url, index, "set") do |existing_url, ordinal|
        if ordinal == index
          buildpack_url
        else
          existing_url
        end
      end
    end
def set
      unless buildpack_url = shift_argument
        error("Usage: heroku buildpacks:set BUILDPACK_URL.\nMust specify target buildpack URL.")
      end

      index = get_index(0)

      mutate_buildpacks_constructive(buildpack_url, index, "set") do |existing_url, ordinal|
        if ordinal == index
          buildpack_url
        else
          existing_url
        end
      end
    end
buildpacks:set BUILDPACK_URL

 set new app buildpack, overwriting into list of buildpacks if neccessary

 -i, --index NUM      # the 1-based index of the URL in the list of URLs

Example:

 $ heroku buildpacks:set -i 1 https://github.com/heroku/heroku-buildpack-ruby