使用 Swift 4.1 将 Vapor 3 beta 应用程序部署到 Heroku 时出现问题

Issue in deploying Vapor 3 beta app to Heroku using Swift 4.1

我正在尝试使用 Vapor 3 beta 和 Swift 4.1 将新的 vapor 应用程序构建部署到 Heroku,但构建过程中经常出现故障。我尝试添加带有 4.1.swift-version 文件,但没有成功。

还尝试使用以下方法设置新的构建包 $ heroku buildpacks:set https://github.com/vapor-community/heroku-buildpack.git

$ vapor --version
Vapor Toolbox: 3.1.4
Vapor Framework: 3.0.0-beta.3.1.3`

这些是我在终端看到的日志

$ git push heroku master
Counting objects: 50, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (40/40), done.
Writing objects: 100% (50/50), 12.55 KiB | 3.14 MiB/s, done.
Total 50 (delta 11), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Swift app detected
remote: -----> Installing clang 5.0.0
remote: -----> Installing swiftenv
remote: Cloning into 'swiftenv'...
remote: -----> Installing Swift 4.1
remote: We don't have build instructions for 4.1.
remote:  !     Push rejected, failed to compile Swift app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to serene-cliffs-74861.
remote: 
To https://git.heroku.com/serene-cliffs-74861.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/serene-cliffs-74861.git'`

在我的 heroku 应用程序中,我看到以下构建日志

-----> Swift app detected
-----> Installing clang 5.0.0
-----> Installing swiftenv
Cloning into 'swiftenv'...
-----> Installing Swift 4.1
We don't have build instructions for 4.1.
!     Push rejected, failed to compile Swift app.
!     Push failed`

谁能帮我解决这个问题。

因为Swift 4.1 目前还没有发布,你需要在你的.swift-version 文件中指定一个开发快照。例如。: 4.1-DEVELOPMENT-SNAPSHOT-2018-03-01-a