蒸汽:git push heroku master 失败

Posted

技术标签:

【中文标题】蒸汽:git push heroku master 失败【英文标题】:Vapor: git push heroku master is failing 【发布时间】:2017-03-31 07:47:41 【问题描述】:

我已经与 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'

我的 repo 的主分支是干净且最新的,没有来自其他地方的未决提交(仅在处理代码)。

任何想法将不胜感激。

谢谢 --TJ

【问题讨论】:

我没有任何智能可提供(但这不会阻止我 :))您在 Mac 上运行吗?这可能是因为您已将本地环境更新为 Swift 3.1,还是在您身边或 Heroku 更新了其他内容?除此之外,您似乎并不孤单:github.com/vapor/vapor/issues/766(请参阅最后几个 cmets)。抱歉,我无法提供实际的解决方案。 嗨。感谢您的回复。是的,我在装有 Swift 3.1 的 Mac 上。虽然远程构建使用 3.0.2 应该是这样(我相信),但看不出这会有什么不同。 【参考方案1】:

哈! Vapor Slack 上的人已经对其进行了分类。 pbodsk,你说得对,因为这是一个 Swift 3.1 问题。

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

3.1

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

请注意,如果您遇到此问题,您也需要这样做:

vapor toolbox broken after upgrading swift

--TJ

【讨论】:

很高兴你找到它:)

以上是关于蒸汽:git push heroku master 失败的主要内容,如果未能解决你的问题,请参考以下文章

HEROKU - 无法运行 git push heroku master [重复]

git push heroku master:Heroku push 被拒绝,没有检测到 Cedar 支持的应用程序

运行 git heroku push master 时出现致命错误

git push heroku master错误权限被拒绝(公钥)[重复]

“Git push heroku master”命令出错

git push heroku master 因解析错误而失败 - 哪个文件?