报错信息
➜ MyService git:(master) ✗ git push heroku master
Counting objects: 43, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (33/33), done.
Writing objects: 100% (43/43), 11.58 KiB | 2.90 MiB/s, done.
Total 43 (delta 2), 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.1.1
remote: 🖥 Operating System: ubuntu1404
remote: 📦 Installing Swiftenv
remote: Cloning into '/app/.swiftenv'...
remote: 🐦 Installing Swift
remote: Downloading https://swift.org/builds/swift-3.1.1-release/ubuntu1604/swift-3.1.1-RELEASE/swift-3.1.1-RELEASE-ubuntu16.04.tar.gz
remote: /tmp/swiftenv-3.1.1- /tmp/build_cb17ea379ff9bebcfbc59b704bf4d24c
remote: % Total % Received % Xferd Average Speed Time Time Time Current
remote: Dload Upload Total Spent Left Speed
remote: 100 117M 100 117M 0 0 6374k 0 0:00:18 0:00:18 --:--:-- 5794k
remote: /tmp/build_cb17ea379ff9bebcfbc59b704bf4d24c
remote: 3.1.1 has been installed.
remote: ✅ Done
remote: -----> Installing clang-3.7.0
remote: precompile
remote: -----> Building Package ... this will take a while
remote: swift-build: error: Package requires minimum Swift tools version 4.0.0. Current Swift tools version is 3.1.0
remote: ! Push rejected, failed to compile Swift app.
remote:
remote: ! Push failed
remote: Verifying deploy...
解决方法在:
在你的vapor工程的根目录下新建.swift-version文件
打开控制台 输入touch .swift-version 新建文件
用编辑器打开文件 open -e .swift-version 输入4.0保存
然后就OK了 因为是属于隐藏文件夹 所以需要手动添加
git add .swift-version
然后编辑
git commit -am "make it better
重新上传。成功
git push heroku master
网友评论