Perfect template

241 Views Asked by At

I'm running this code in swift with the perfect template framework using Swift Package Mannager

var values: MustacheEvaluationContext.MapType

func extendValuesForResponse(context contxt: MustacheWebEvaluationContext, collector: MustacheEvaluationOutputCollector) {
    contxt.extendValues(with: values)
    do {
        try contxt.requestCompleted(withCollector: collector)
    } catch {
        let response = contxt.webResponse
        response.appendBody(string: "\(error)")
            .completed(status: .internalServerError)
    }
}

and get this error: fileError(2, "No such file or directory /home/ubuntu/PerfectTemplate/.build/checkouts/PerfectLib.git--5188670293928734099/Sources/PerfectLib/File.swift open(_:permissions:) 246")

1

There are 1 best solutions below

1
On

are you running the Perfect server app on ubuntu or Xcode? if using Xcode, please choose the menu item "Product > Scheme > Edit Scheme…" and in the Options tab set the "Use Custom Working Directory" to your projects folder. This will enable you to run from within Xcode and still easily access files given relative paths.

if using a terminal to run it, just make sure that under the project folder and go "swift run"