I am working on a project in Clojure. I tried to migrate my latest DB commit to my local using the command
PROFILE=dev lein ragtime migrate
Getting this error:
clojure.lang.Compiler$CompilerException: Syntax error macroexpanding clojure.core/fn at (clojure/core/unify.clj:83:18).
:clojure.error{:phase :macro-syntax-check, :line 83, :column 18, :source "clojure/core/unify.clj", :symbol clojure.core/fn}
Introduction Leiningen is a modern build system for our Clojure projects. It's also written and configured entirely in Clojure. It works similarly to Maven, giving us a declarative configuration that describes our project, without needing to configure exact steps to be executed.
Note that the main source namespace is my-project.core, and is found in the file my_project/core.clj. It's discouraged in Clojure to use single-segment namespaces – the equivalent of top-level classes in a Java project.
Also, notice that Clojure is just a dependency here. This makes it trivial to write projects using whatever version of the Clojure libraries are desired, and especially to have multiple different versions running on the same system.
Creating a New Project Once Leiningen is installed, we can use it to create a new project by invoking lein new. This creates a project using a particular template from a set of options: For example, to create a new application called “my-project” we would execute:
I also encountered this issue with Leiningen 2.9.1. In my case it turned out to occur due to the lein-ring
plugin which depends on an outdated unify
version. The issue is already fixed in the newest lein-ring
version though: https://github.com/weavejester/lein-ring/issues/203. So upgrading lein-ring
to 0.12.5
fixed it for me.
I'm not 100% sure what this issue is, but it seems to be related to leiningen 2.9.x.
At first, I ran leiningen v 2.8.x (don't remember which version exactly). Then everything worked fine.
Then I updated leiningen to 2.9.1, and I got this error the next time I tried to build with leiningen.
We then updated ring
from version 1.4.0 to 1.7.1, and the error disappeared.
Alternatively, if you have to use an old version of a library, the only fix seems to be to downgrade to leiningen 2.8:
lein upgrade 2.8.3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With