swift - 无法使用 Vapor 将 swift 包推送到 Heroku

标签 swift heroku discord vapor

我正在尝试使用 Vapor 构建包 ( https://github.com/vapor-community/heroku-buildpack/tree/master ) 将 Swift 包推送到 Heroku,但我不断收到此错误:

错误:终止(1):/app/tmp/cache/heroku-18/swiftenv/versions/4.2/usr/bin/swift-build-tool -f/tmp/build_1041959f11306dce64ad9d4712e1d962/.build/debug .yaml主要输出:

我使用 Swift 5.2 编写了该包,但 Heroku 坚持使用 Swift 4.2。我已确认该 buildpack 与 Swift 5.2 兼容,并且我已将 .swift-version 文件以及 Package.swift 文件的第一行设置为 5.2。

这是 Package.swift 文件:

    // swift-tools-version:5.2
    // The swift-tools-version declares the minimum version of Swift required to build this package.

    import PackageDescription

    let package = Package(
name: "TurnipBot",
dependencies: [
    // Dependencies declare other packages that this package depends on.
    .package(url: "https://github.com/Azoy/Sword", .branch("master"))

],
targets: [
    // Targets are the basic building blocks of a package. A target can define a module or a test suite.
    // Targets can depend on other targets in this package, and on products in packages which this package depends on.
    .target(
        name: "TurnipBot",
        dependencies: ["Sword"]),
    .testTarget(
        name: "TurnipBotTests",
        dependencies: ["TurnipBot"]),
]
    )

最佳答案

您确实提交了 .swift-version 文件吗?拼写是否正确等?我在one of my apps中使用过它并且部署得很好

关于swift - 无法使用 Vapor 将 swift 包推送到 Heroku,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60979749/

相关文章:

ios - Swift 3 - 覆盖 UINavigationController 的初始值设定项以设置 rootviewcontroller

Swift:使用静态方法连接静态按钮

node.js - 如何使用 IP 白名单将 Heroku 上的应用程序连接到 Atlas 中的数据库?

python - css 在本地工作但在部署到 heroku flask 后失败

python-3.x - 机器人两次执行相同的命令

ios - 当离开节点位置时,触摸事件不会使 spritenode 重置其大小

ios - 只在 UITableView 中删除一些行 [Swift 3.0 - Xcode 8]

python - 如何使用 docker 将 django cookiecutter 项目上传和部署到 heroku?

bots - 删除服务器中的所有 channel

javascript - 如何获取特定 Discord 角色的名称?