Vapor:git push heroku master失败了

时间:2017-03-31 07:47:42

标签: swift git heroku master vapor

我已经和Vapor和Heroku一起工作了几个星期,而且一切顺利。蒸汽很棒! ;]我已经使用git push heroku master成功更新Heroku上的应用程序,直到昨天晚上我开始收到此错误:

$ git push heroku master
Counting objects: 26, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (24/24), done.
Writing objects: 100% (26/26), 7.37 KiB | 0 bytes/s, done.
Total 26 (delta 15), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Swift app detected
remote: Cloning into 'swiftenv'...
remote: Swift 3 Heroku Installer
remote:   Version: 3.0.2
remote:   Operating System: ubuntu1404
remote:  Installing Swiftenv
remote: Cloning into '/app/.swiftenv'...
remote:  Installing Swift
remote: Downloading https://swift.org/builds/swift-3.0.2-release/ubuntu1404/swift-3.0.2-RELEASE/swift-3.0.2-RELEASE-ubuntu14.04.tar.gz
remote: /tmp/swiftenv-3.0.2- /tmp/build_577666a1ce2003bd1d820e031bc0f306
remote:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
remote:                                  Dload  Upload   Total   Spent    Left  Speed
remote: 100  113M  100  113M    0     0  8057k      0  0:00:14  0:00:14 --:--:-- 8613k
remote: /tmp/build_577666a1ce2003bd1d820e031bc0f306
remote: 3.0.2 has been installed.
remote: ✅  Done
remote: precompile
remote: -----> Installing toolbox
remote: Downloading...
remote: Compiling...
remote: <unknown>:0: error: build had 1 command failures
remote: swift-build: error: exit(1): /app/.swiftenv/versions/3.0.2/usr/bin/swift-build-tool -f /tmp/build_577666a1ce2003bd1d820e031bc0f306/vapor-toolbox/.build/debug.yaml
remote:  !     Push rejected, failed to compile Swift app.
remote: 
remote:  !     Push failed
remote: Verifying deploy....
remote: 
remote: !   Push rejected to zzzzzzzz.
remote: 
To https://git.heroku.com/zzzzzzzz.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/zzzzzzzz.git'

我的仓库的主分支是干净的,最新的,没有其他地方的待处理(只有代码处理)。

任何想法都会非常感激。

由于 --TJ

1 个答案:

答案 0 :(得分:1)

哈! Vapor Slack上的那些人对它进行了分类。 pbodsk,你说得对,这是一个Swift 3.1问题。

您需要在Vapor项目的根目录中创建一个.swift-version文件。该文件的内容很简单:

3.1

当它被推送到Heroku时,它将使用正确版本的Swift进行编译。

请注意,如果您遇到此问题,还需要执行此操作:

vapor toolbox broken after upgrading swift

- TJ