“虽然lein在我的exec-path(macOS)上,但是clojure可执行文件不在你的'exec-path'上”

时间:2018-02-26 16:04:16

标签: clojure cider

我有以下exec-path(根据describe-variable):

("/usr/local/bin/" "/usr/bin/" "/bin/" "/usr/sbin/" "/sbin/" "/usr/local/Cellar/emacs-plus/25.3/libexec/emacs/25.3/x86_64-apple-darwin16.7.0/") 

这是lein可执行路径:

/usr/local/bin/lein

当我运行cider-jack-in时会发生这种情况:

The clojure executable isn’t on your ‘exec-path’

是什么给出了?

修改:(cider-lein-commandlein

2 个答案:

答案 0 :(得分:6)

我想建立 Jonah Benton 的答案,以回应 ackerleytng 关于如何配置苹果酒使用的问题莱恩代替:

要将cider build命令从clojure更改为lein,请将lein设置为变量class CrawlEverythingSpider(CrawlSpider): name = "crawl_everything" allowed_domains = domains start_urls = urls rules = ( Rule(LinkExtractor(), callback='parse_item', follow=True ), ) def parse_item(self, response): item = {} item['url'] = response.url try: item['title'] = response.xpath("//title/text()").extract_first() except (AttributeError, NotSupported) as e: return meta_names = response.xpath("//meta/@name").extract() meta_properties = response.xpath("//meta/@property").extract() for name in meta_names: item[name] = response.xpath("//meta[@name='" + name + "']/@content").extract_first() for property in meta_properties: item[property] = response.xpath("//meta[@property='" + property + "']/@content").extract_first() yield item 的值。

对于emacs初学者,您可以使用键cider-default-repl-command查看和更改变量值。

答案 1 :(得分:5)

(来自评论)

看起来cider正在寻找clojure命令,而不是lein命令。 " Clojure的"是使用新cli工具引入的可执行文件:

https://clojure.org/guides/deps_and_cli