Clojure 编译错误,包括项目中的clj时间

Clojure 编译错误,包括项目中的clj时间,clojure,jodatime,Clojure,Jodatime,我已将[clj时间“0.8.0”]包括在我的项目中。clj。然后,我在名称空间中引用clj时间,如下所示: (ns school-finder.tasks (:require [clj-time.core :as t])) 但是,当我尝试运行该项目时,会出现以下编译错误: Exception in thread "main" java.lang.IllegalArgumentException: No single method: second of interface: clj_time

我已将[clj时间“0.8.0”]包括在我的项目中。clj。然后,我在名称空间中引用clj时间,如下所示:

(ns school-finder.tasks
  (:require [clj-time.core :as t]))
但是,当我尝试运行该项目时,会出现以下编译错误:

Exception in thread "main" java.lang.IllegalArgumentException: No single method: second of interface: clj_time.core.DateTimeProtocol found for function: second of protocol: DateTimeProtocol, compiling:(clj_time/coerce.clj:146:64)

我做错了什么?

很难说问题出在哪里,所以这里有一个有效的例子:

project.clj:

(defproject hello "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"}
  :dependencies [[org.clojure/clojure "1.5.1"]
                 [clj-time "0.8.0"]]
  :source-paths ["dev"])
src/hello/core.clj:

(ns hello.core
  (:require [clj-time.core :as t]))

(println (t/now))

我认为这是一个已知的错误:


如果你只是做一个
lein clean
(可能后面跟着一个
lein deps
),应该可以解决这个问题。

我有一个最小的工作项目,就像你建议的那样,它可以工作。然而,在我的实际项目中,我遇到了如上所述的问题。我不确定的是编译问题的原因可能是什么,以及如何跟踪问题的一些想法。lein deps:tree,然后查看输出,看看您是否实际使用了指定的clj时间版本。如果您可以包含更多导致错误的代码,这将有所帮助