swift - 无法使用 Vapor 将 swift 包推送到 Heroku
问题描述
我正在尝试使用 Vapor buildpack(https://github.com/vapor-community/heroku-buildpack/tree/master)将 Swift 包推送到 Heroku,但我不断收到此错误:
error: terminated(1): /app/tmp/cache/heroku-18/swiftenv/versions/4.2/usr/bin/swift-build-tool -f /tmp/build_1041959f11306dce64ad9d4712e1d962/.build/debug.yaml main output:
我使用 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
文件了吗?它拼写是否正确等?我已经在我的一个应用程序中使用它并且部署得很好
推荐阅读
- python - 如何检测表格的水平和垂直线并消除噪音?
- ios - 在 Xcode + Swift 中,变量名前的正斜杠有什么作用?
- c# - 使用 github 操作部署时更改 appsettings 中的变量
- linux - Docker:运行自动确定数量的容器
- android - 使约束布局不可触碰
- c# - EF Core 2.1 - 没有为此 DbContext 配置数据库提供程序
- c - 未定义的函数引用?
- r - 如何在r中为数据框的不同列编写循环?
- css - 为什么包装类在 Vue.js 中不起作用?
- pyspark - Azure Databricks 到 Azure SQL DW:长文本列