如何使用 slime 解决 sbcl 中的名称服务错误?

问题描述

我最近安装了 SLIME 模式,但无法正常工作。启动时 (M-x slime) 它抛出这个错误:

This is SBCL 2.1.1,an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software,provided as is,with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
* ; loading #P"/home/logan/quicklisp/dists/quicklisp/software/slime-v2.26.1/swank-loader.lisp"
WARNING:
   redefining EMACS-INSPECT (#<SB-PCL:SYSTEM-CLASS COMMON-LISP:T>) in DEFMETHOD

debugger invoked on a SB-BSD-SOCKETS:HOST-NOT-FOUND-ERROR in thread
#<THREAD "main thread" RUNNING {1004DD81F3}>:
  Name service error in "getaddrinfo": -2 (Name or service not known)

Type HELP for debugger help,or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [USE-VALUE] Try a port other than 0
  1: [ABORT    ] Exit debugger,returning to top level.

(SB-BSD-SOCKETS:NAME-SERVICE-ERROR "getaddrinfo" -2)
   source: (= ERRNO SB-BSD-SOCKETS-INTERNAL::NETDB-INTERNAL)

如果我中止,我仍然可以很好地使用 repl。但是,我正在尝试在 org 模式下创建一个通用的 lisp 源代码块,如下所示:

#+begin_src lisp
(princ "test")
#+end_src

运行这个块C-c C-c后,我得到的是:

Polling "/tmp/slime.xxxx" .. 123 (Abort with 'M-x slime-abort-connection')

“getaddrinfo 中的名称服务错误”是什么意思?我试过搜索这个,但我找不到任何东西。

顺便说一句,如果有帮助,我正在使用 artix linux。

解决方法

嗯,这是一个面对面的时刻。我目前住在大学校园里,所以我让 /etc/hosts 将所有主机指向我分配的 IPv4。必须在该文件中添加一个 localhost 主机。

https://wiki.archlinux.org/title/Network_configuration

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...