gpt4 book ai didi

google-app-engine - lein appengine-prepare 失败

转载 作者:行者123 更新时间:2023-12-04 06:29:30 25 4
gpt4 key购买 nike

我正在尝试按照 https://github.com/gcv/appengine-magic 中的示例使 Clojure/Compojure/appengine-magic 工作

但是当我运行 lein appengine-prepare我得到:

Exception in thread "main" C:\Users\henrik\IdeaProjects\simple-example\lib\dev not found. (NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:5440)
at clojure.lang.Compiler.eval(Compiler.java:5391)
at clojure.core$eval.invoke(core.clj:2382)
at clojure.main$eval_opt.invoke(main.clj:235)
at clojure.main$initialize.invoke(main.clj:254)
at clojure.main$script_opt.invoke(main.clj:270)
at clojure.main$main.doInvoke(main.clj:354)
at clojure.lang.RestFn.invoke(RestFn.java:457)
at clojure.lang.Var.invoke(Var.java:377)
at clojure.lang.AFn.applyToHelper(AFn.java:172)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.main.main(main.java:37)
Caused by: C:\Users\henrik\IdeaProjects\simple-example\lib\dev not found.

我错过了什么吗?
lein new simple-example
编辑 project.clj:
(defproject simple-example "1.0.0-SNAPSHOT"
:description "FIXME: write description"
:dependencies [[org.clojure/clojure "1.2.1"] [appengine-magic "0.4.1"]])
lein deps lein appengine-new
编辑 core.clj:
(ns simple-example.core
(:use compojure.core)
(:require [appengine-magic.core :as ae]))

(defroutes simple-example-app-handler
(GET "/" req
{:status 200
:headers {"Content-Type" "text/plain"}
:body "Hello, world!"})
(GET "/hello/:name" [name]
{:status 200
:headers {"Content-Type" "text/plain"}
:body (format "Hello, %s!" name)})
(ANY "*" _
{:status 200
:headers {"Content-Type" "text/plain"}
:body "not found"}))

(ae/def-appengine-app simple-example-app #'simple-example-app-handler)
lein appengine-prepare

最佳答案

文档指出 appengine-magic应该添加到 :dev-dependencies .通过从头开始创建项目并尝试运行 appengine-prepare,我能够重现您的问题。当appengine-magic:dependencies .

所以而不是:

(defproject simple-example "1.0.0-SNAPSHOT"
:description "FIXME: write description"
:dependencies [[org.clojure/clojure "1.2.1"] [appengine-magic "0.4.1"]])

你应该有:
(defproject simple-example "1.0.0-SNAPSHOT"
:description "FIXME: write description"
:dependencies [[org.clojure/clojure "1.2.1"]]
:dev-dependencies [[appengine-magic "0.4.1"]])

这应该有望解决您的问题。

关于google-app-engine - lein appengine-prepare 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5613977/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com