我正在尝试使用ring和lein进行我的第一次运行,并且我遇到了让它运行的问题。我从“使用Clojure进行Web开发”,第1章以及https://quickleft.com/blog/your-first-clojure-web-app/这本书中采用了这个例子。这两个站点的代码都给出了同样的错误 - 找不到类。
我有以下project.clj
(defproject myfirstwebapp "0.1.1"
:description "A hello world for a Ring based web app"
:dependencies [[org.clojure/clojure "1.8.0"]
[ring "1.4.0"]]
:plugins [[lein-ring "0.9.7"]]
:dev-dependencies [[lein-ring "0.9.7"]]
:ring {:handler myfirstwebapp.core/app})
以下core.clj
(ns myfirstwebapp.core)
(defn app [req]
{:status 200
:headers {"content-Type" "text/html"}
:body "Hello World!"})
我跑的命令是:
lein new myfirstwebapp
edit project.clj as above
cd myfirstwebapp
lein deps
edit src/myfirstwebapp/core.clj as above
lein ring server
现在我收到的错误如下:
线程“main”中的异常java.lang.ClassNotFoundException:leiningen.core.project $ reduce_repo_step,编译:(C:\ Users \ ROG \ form-init7789757414629005682.clj:1:17608)
我使用的不同组件的版本之间是否存在不匹配?或其他什么?