我试图从lein new compojure clojure-lice运行样板项目。

当我运行lein ring server时,会收到以下错误提示:

Exception in thread "main" java.lang.RuntimeException: No reader function for tag namespace


我的project.clj

(defproject clojure-lice "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :min-lein-version "2.0.0"
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [compojure "1.5.1"]
                 [ring/ring-defaults "0.2.1"]]
  :plugins [[lein-ring "0.9.7"]]
  :ring {:handler clojure-lice.handler/app}
  :profiles
  {:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
                        [ring/ring-mock "0.3.0"]]}})


我的core.clj

(ns clojure-lice.handler
  (:require [compojure.core :refer :all]
            [compojure.route :as route]
            [ring.middleware.defaults :refer [wrap-defaults site-defaults]]))

(defroutes app-routes
  (GET "/" [] "Hello World")
  (route/not-found "Not Found"))

(def app
  (wrap-defaults app-routes site-defaults))


我的系统统计:

java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

Leiningen 2.8.0 on Java 9.0.1 Java HotSpot(TM) 64-Bit Server VM

Clojure 1.8.0
OSX 10.12.6

最佳答案

尝试将Leiningen降级为2.7.1:

lein upgrade 2.7.1


这是Leiningen 2.8.0中的回归。请参见https://github.com/technomancy/leiningen/issues/2328

关于java - 新的compojure模板无法启动“标签 namespace 无读取器功能”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/46878428/

10-09 02:37