提问人:Freeze Dolphin 提问时间:6/15/2023 最后编辑:Freeze Dolphin 更新时间:6/16/2023 访问量:84
Leiningen 无法启动 REPL:“无法解析符号:在此上下文中创建”
Leiningen unable to start a REPL: "Unable to resolve symbol: create in this context"
问:
我只是从草书(IntelliJ IDEA)切换到Emacs
但是我不能从CIDER和lein启动REPL......
它只是说Unable to resolve symbol: create in this context
但是在我的代码中,我没有调用create
最重要但奇怪的是,可以成功编译它!lein jar
存储库:https://github.com/freeze-dolphin/Dumortierite/tree/master/clj-module
在“更简单”的项目中启动 REPL 是成功的
/tmp/clojure-16814102007241783435.edn
{:clojure.main/message
"Syntax error compiling at (/tmp/form-init4774226856010620214.clj:4354:33).\nUnable to resolve symbol: create in this context\n",
:clojure.main/triage
{:clojure.error/phase :compile-syntax-check,
:clojure.error/line 4354,
:clojure.error/column 33,
:clojure.error/source "form-init4774226856010620214.clj",
:clojure.error/path "/tmp/form-init4774226856010620214.clj",
:clojure.error/class java.lang.RuntimeException,
:clojure.error/cause
"Unable to resolve symbol: create in this context"},
:clojure.main/trace
{:via
[{:type clojure.lang.Compiler$CompilerException,
:message
"Syntax error compiling at (/tmp/form-init4774226856010620214.clj:4354:33).",
:data
{:clojure.error/phase :compile-syntax-check,
:clojure.error/line 4354,
:clojure.error/column 33,
:clojure.error/source "/tmp/form-init4774226856010620214.clj"},
:at [clojure.lang.Compiler analyze "Compiler.java" 6825]}
{:type java.lang.RuntimeException,
:message "Unable to resolve symbol: create in this context",
:at [clojure.lang.Util runtimeException "Util.java" 221]}],
:trace
[[clojure.lang.Util runtimeException "Util.java" 221]
[clojure.lang.Compiler resolveIn "Compiler.java" 7431]
[clojure.lang.Compiler resolve "Compiler.java" 7375]
[clojure.lang.Compiler analyzeSymbol "Compiler.java" 7336]
[clojure.lang.Compiler analyze "Compiler.java" 6785]
[clojure.lang.Compiler analyze "Compiler.java" 6762]
[clojure.lang.Compiler$HostExpr$Parser parse "Compiler.java" 1020]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7124]
[clojure.lang.Compiler analyze "Compiler.java" 6806]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7112]
[clojure.lang.Compiler analyze "Compiler.java" 6806]
[clojure.lang.Compiler access$300 "Compiler.java" 38]
[clojure.lang.Compiler$LetExpr$Parser parse "Compiler.java" 6401]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7124]
[clojure.lang.Compiler analyze "Compiler.java" 6806]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7112]
[clojure.lang.Compiler analyze "Compiler.java" 6806]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7112]
[clojure.lang.Compiler analyze "Compiler.java" 6806]
[clojure.lang.Compiler analyze "Compiler.java" 6762]
[clojure.lang.Compiler$InvokeExpr parse "Compiler.java" 3900]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7126]
[clojure.lang.Compiler analyze "Compiler.java" 6806]
[clojure.lang.Compiler analyze "Compiler.java" 6762]
[clojure.lang.Compiler$InvokeExpr parse "Compiler.java" 3900]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7126]
[clojure.lang.Compiler analyze "Compiler.java" 6806]
[clojure.lang.Compiler access$300 "Compiler.java" 38]
[clojure.lang.Compiler$LetExpr$Parser parse "Compiler.java" 6401]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7124]
[clojure.lang.Compiler analyze "Compiler.java" 6806]
[clojure.lang.Compiler analyze "Compiler.java" 6762]
[clojure.lang.Compiler$BodyExpr$Parser parse "Compiler.java" 6137]
[clojure.lang.Compiler$FnMethod parse "Compiler.java" 5479]
[clojure.lang.Compiler$FnExpr parse "Compiler.java" 4041]
[clojure.lang.Compiler analyzeSeq "Compiler.java" 7122]
[clojure.lang.Compiler analyze "Compiler.java" 6806]
[clojure.lang.Compiler eval "Compiler.java" 7191]
[clojure.lang.Compiler eval "Compiler.java" 7184]
[clojure.lang.Compiler eval "Compiler.java" 7184]
[clojure.lang.Compiler load "Compiler.java" 7653]
[clojure.lang.Compiler loadFile "Compiler.java" 7591]
[clojure.main$load_script invokeStatic "main.clj" 475]
[clojure.main$init_opt invokeStatic "main.clj" 477]
[clojure.main$init_opt invoke "main.clj" 477]
[clojure.main$initialize invokeStatic "main.clj" 508]
[clojure.main$null_opt invokeStatic "main.clj" 542]
[clojure.main$null_opt invoke "main.clj" 539]
[clojure.main$main invokeStatic "main.clj" 664]
[clojure.main$main doInvoke "main.clj" 616]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.main main "main.java" 40]],
:cause "Unable to resolve symbol: create in this context",
:phase :compile-syntax-check}}
答:
0赞
Alan Thompson
6/16/2023
#1
经过一些实验,问题似乎出在这条线上:
(ns io.sn.dumortierite.clj_module.items
(:import
...
[io.sn.dumortierite.utils ClojureUtils ItemEffectUtils]
...
))
您的项目中没有提到的库。事实上,观察:
~/expr/so/Dumortierite/clj-module > d lib lib/**/*
drwx------ 3 alan alan 4096 Jun 15 09:17 lib/
drwx------ 2 alan alan 4096 Jun 15 09:17 lib/Dumortierite-0.1.0.jar/
请注意,“JAR”文件实际上是一个 unix 目录。
可能还有其他问题,但这个绝对是一个障碍。
评论
0赞
Freeze Dolphin
6/16/2023
我认为你应该跑进去生成它。顺便说一句,我现在使用 LSP 而不是 CIDER,所以现在没有问题......refresh.sh
clj-module
评论
lein new app test-project
)