spacemacs| SPC / (ag)报错error code 127

长期VIM用户,刚开始尝试spacemacs,很多知识还不是很明白 系统:OS X 10.13.6 Emacs: GNU Emacs 26.1 Spacemacs: 最新的develop分支

使用VIM的时候,系统中安装了the silver search 2.2.0,在VIM中ag正常使用。

安装Spacemacs并使用默认设置后,每次调用SPC /(ag) 后,输入3个字符后就显示error code 127。使用网上的方法,安装exec-path-from-shell也不行,将系统中的$PATH清理后还是不行,实在是不知道怎么解决了。

希望将Emacs作用开发环境,能够实现方便的文件查找和函数定义调转、关键字搜索等。 希望能够得到社区的帮助,谢谢!

-添加信息-

$echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

/usr/local/bin中有一个ag 通过brew安装了the silver searcher ag:/usr/local/Cellar/the_silver_searcher/2.1.0/bin/

exec-path-from-shell的配置没有找到spacemacs的,按晚上的emacs的设置方法为,在dotspacemacs/user-init中加入了: (setq-default counsel-ag-base-command “/usr/local/Cellar/the_silver_searcher/2.1.0/bin/ag --vimgrep --nocolor --nogroup %s”)

贴上环境变量 $PATHag 安装的位置。

配置做到位了吗

-添加信息-

$echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

/usr/local/bin中有一个ag 通过brew安装了the silver searcher ag:/usr/local/Cellar/the_silver_searcher/2.1.0/bin/

exec-path-from-shell的配置没有找到spacemacs的,按晚上的emacs的设置方法为,在dotspacemacs/user-init中加入了: (setq-default counsel-ag-base-command “/usr/local/Cellar/the_silver_searcher/2.1.0/bin/ag --vimgrep --nocolor --nogroup %s”)

这个去掉。

最简单的: 在 dotspacemacs/user-config 加上

(add-to-list 'exec-path "/usr/local/bin")
(defun dotspacemacs/user-config ()
  "Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration.
This is the place where most of your configurations should be done. Unless it is
explicitly specified that a variable should be set before a package is loaded,
you should place your code here."
(add-to-list 'exec-path "/usr/local/bin")
  )

已加,还是error code 127

感觉要找找这个127是谁报的错,然后它究竟是什么意思……

(executable-find "ag")执行下,看下能找到ag不。我执行出来的是"/usr/local/bin/ag"

127: executable not found

1 个赞

发现ivy有报错,屏蔽后用helm-ag代替了,感谢各位的帮助

ivy 和 helm 不能一起用,会有冲突