谷歌应用程序引擎- lein appengine-prepare失败



我正在尝试获得Clojure/Compojure/appengine-magic工作以下的例子在https://github.com/gcv/appengine-magic

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

Exception in thread "main" C:UsershenrikIdeaProjectssimple-examplelibdev 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:UsershenrikIdeaProjectssimple-examplelibdev 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-magic:dependencies中时运行appengine-prepare来重现您的问题。

所以不是:

(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"]])

希望能解决你的问题。

相关内容

最新更新