【发布时间】:2017-06-14 14:39:00
【问题描述】:
我目前正在通过命令行在我正在制作的名为 reagent_test 的项目中使用 Leiningen 和 Ring,但遇到了一个问题:
C:/...reagent_test>lein ring server
... huge chunk of errors
Caused by: java.io.FileNotFoundException: Could not locate reagent_test/core__init.class or reagent_test/core.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
... more errors
如果有人想要这个问题的要点,如果需要,我会做一个。
问题是,文件都在正确的位置。这是我的project.clj:
(defproject reagent-test "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:plugins [[lein-cljsbuild "1.1.5"]
[lein-ring "0.10.0"]]
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.456"]
[ring "1.4.0"]
[leiningen "2.7.1"]
[reagent "0.6.0"]
[garden "1.3.2"]]
:cljsbuild {:builds {:app {:source-paths ["src/cljs"]}
:compiler {:output-to "resources/public/main.js"
:pretty-print true}}}
:ring {:handler reagent-test.core/-main})
而我的项目结构是这样的(至少,对于相关文件来说):
src:
clj:
reagent_test:
core.clj
cljs:
reagent_test:
core.cljs
project.clj
在core.clj 和core.cljs 中,我都有这个作为我的命名空间:
(ns reagent-test.core)
注意:文件夹有冒号,文件没有。
【问题讨论】: