【问题标题】:Vapor app failing to deploy on Heroku: We don't have Build instructions for ’5.1.3’Vapor 应用程序无法在 Heroku 上部署:我们没有“5.1.3”的构建说明
【发布时间】:2020-06-20 07:47:43
【问题描述】:

我正在尝试在 Heroku 上部署 Vapor 4 应用程序。它失败并出现以下错误:

   remote: Building source:
   remote: 
   remote: -----> Swift app detected
   remote: -----> Using Swift ’5.1.3’ (from .swift-version file)
   remote: -----> Installing clang 7.0.1
   remote: -----> Installing Swiftenv
   remote: -----> Installing Swift ’5.1.3’
   remote: We don't have Build instructions for ’5.1.3’.
   remote:!     Push rejected, failed to compile the Swift app.
   remote: 
   remote:!     Push failed
   remote: Verifying deploy...
   remote: 
   remote:! Push rejected to 
   remote:
   

这是我的包裹描述:

// swift-tools-version:5.1
import PackageDescription
       
let package = Package(
       name: "ashi-apns",
       platforms: [
          .macOS(.v10_15),
       ],
       dependencies: [
         // ???? A server-side Swift web framework.
          .package(url: "https://github.com/vapor/fluent.git", from: "4.0.0-rc"),
          .package(url: "https://github.com/vapor/fluent-postgresql.git", from: "2.0.0-rc"),
          .package(url: "https://github.com/vapor/vapor.git", from: "4.3.0"),
          .package(url: "https://github.com/kylebrowning/APNSwift.git", from: "2.0.0-rc1"),
          .package(url: "https://github.com/MihaelIsaev/FCM.git", from: "2.7.0"),
          //.package(url: "https://github.com/vapor/jwt.git", from: "4.0.0-rc"),    
          // .product(name: "Leaf", package: "leaf"),
          //.package(url: "https://github.com/vapor/leaf.git", from: "4.0.0-rc"), //.product(name: "JWT", package: "jwt"), 
      ],
      targets: [
         .target(
            name: "App", 
            dependencies: [
              .product(name: "Fluent", package: "fluent"),
              .product(name: "FluentPostgresDriver", package: "fluent-postgres-driver"),
              .product(name: "Vapor", package: "vapor"),
              "APNSwift",
              .product(name: "FCM", package: "FCM"),
            ]),
               
            .target(name: "Run", dependencies: [
               .target(name: "App"),
            ]),
               
            .testTarget(name: "AppTests", dependencies: [
               .target(name: "App"),
            ])
        ]
 )

我正在使用这个 buildpack:

heroku buildpacks:set https://github.com/vapor-community/heroku-buildpack

使用相同的 buildpack,我可以部署 v3 应用。

为什么 Heroku 不能构建 Swift 5.1.3?

【问题讨论】:

    标签: ios swift git heroku vapor


    【解决方案1】:
    Using Swift ’5.1.3’ (from .swift-version file)
    

    那些引用看起来很有趣。我敢打赌你的.swift-version 文件确实包含

    ’5.1.3’
    

    而它应该包含

    5.1.3
    

    去掉引号,提交,再次部署。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-04-07
      • 2014-11-26
      • 2017-09-04
      • 2023-03-23
      • 2016-06-23
      • 2013-08-22
      • 2018-04-11
      相关资源
      最近更新 更多