简体   繁体   English

Swift蒸气样品未编译

[英]Swift Vapor Sample Not compiling

I'm trying to get my feet wet with server side swift, and specifically Swift Vapor by trying the Ray Wenderlich HelloVapor tutorial. 我试图通过尝试Ray Wenderlich HelloVapor教程让服务器端迅速着迷,特别是Swift Vapor。

Basically performed the following steps so far using (my swift -version on Apple command prompt is Apple Swift version 4.1.2) 到目前为止,基本上已经使用了以下步骤(我在Apple命令提示符下的swift -version是Apple Swift版本4.1.2)

Here are the steps I've followed to setup Vapor and try the sample. 这是我设置蒸气并尝试样品的步骤。

  1. On command prompt 在命令提示符下

在此处输入图片说明

  1. Open browser to https://brew.sh for instructions to setup homebrew (Copy and paste the following in a command prompt on terminal) 打开浏览器到https://brew.sh以获取设置自制程序的说明(将以下内容复制并粘贴到终端的命令提示符中)

在此处输入图片说明

  1. Then run the following commands to install vapor and the vapor sample app HelloVapor in folder vaporsample. 然后运行以下命令以将蒸气和蒸气样品应用程序HelloVapor安装在文件夹vaporsample中。

在此处输入图片说明

  1. However when I try to build the run target I get the following compile errors: 但是,当我尝试构建运行目标时,出现以下编译错误:

在此处输入图片说明

It appears it cant find the modules. 似乎找不到模块。 Or perhaps an incorrect version of swift (I am on Swift version 4.1.2 on my Mac). 或swift的版本不正确(我在Mac上为Swift 4.1.2版)。 I'm confused and would like to seek the advise of the erudite crowd here. 我很困惑,想在这里寻求博学的人群的建议。

Following a tip from @Marc (see comments) "You might do well to update to the current release Xcode 9.4.1 and say "yes" to the install the Xcode command tools on first launch. After an installation of the Xcode command lines tools you should no longer need to add Xcode to $PATH. In my case, I don't modify $PATH for any general (non-beta) Xcode release to get Vapor to build & run. – l --marc" 遵循@Marc的提示(请参阅注释):“您可以很好地更新到当前版本的Xcode 9.4.1,并在第一次启动时对安装Xcode命令工具说“是”。安装Xcode命令行工具后您无需再将Xcode添加到$ PATH。就我而言,我无需为任何通用(非Beta版)Xcode版本修改$ PATH即可构建和运行Vapor。– l --marc”

I followed Marc's tip and the Vapor sample project buolt and ran with no issues in Xcode 9.4.1. 我遵循了Marc的技巧,Vapor示例项目被修改,并且在Xcode 9.4.1中没有任何问题。

Thanks Marc. 谢谢马克。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM