ocamlfind 的编译在“install -m 0755 ocaml-stub”处失败

The compilation of ocamlfind failed at "install -m 0755 ocaml-stub

我是 OCaml 的新手,我正在尝试安装 cohttp。由于我没有接受 Xcode 许可协议 (OS X Sierra 10.12.6) 失败后,包管理器 (opam) 尝试安装子依赖项时出现错误,ocamlfind.

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=   
[ERROR] The compilation of ocamlfind failed at "install -m 0755 ocaml-stub /Users/greg/.opam/system/bin/ocaml".
Processing  1/27: [ocamlfind: rm]
#=== ERROR while installing ocamlfind.1.7.3-1 =================================#
# opam-version 1.2.2
# os           darwin
# command      install -m 0755 ocaml-stub    /Users/greg/.opam/system/bin/ocaml
# path         /Users/greg/.opam/system/build/ocamlfind.1.7.3-1
# compiler     system (4.05.0)
# exit-code    127
# env-file     /Users/greg/.opam/system/build/ocamlfind.1.7.3-1/ocamlfind-93888-487c34.env
# stdout-file  /Users/greg/.opam/system/build/ocamlfind.1.7.3-1/ocamlfind-93888-487c34.out
# stderr-file  /Users/greg/.opam/system/build/ocamlfind.1.7.3-1/ocamlfind-93888-487c34.err

日志文件为空。环境文件有这个(轻微编辑):

PATH=/Users/greg/.opam/system/bin:/usr/local/google-cloud-sdk/bin:/Users/greg/.nvm/versions/node/v6.5.0/bin::/opt/chefdk/bin:/usr/local/mysql/bin:/usr/local/share/npm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/greg/.chefdk/gem/ruby/2.1.0/bin
OCAML_TOPLEVEL_PATH=/Users/greg/.opam/system/lib/toplevel
PERL5LIB=/Users/greg/.opam/system/lib/perl5:
MANPATH=/Users/greg/.opam/system/man:/Users/greg/.nvm/versions/node/v6.5.0/share/man:/usr/local/mysql/man:/usr/local/share/man:/usr/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man
OPAMSWITCH=system
OPAMUTF8MSGS=1
CAML_LD_LIBRARY_PATH=/Users/greg/.opam/system/lib/stublibs:/usr/local/lib/ocaml/stublibs
TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/fq/9ggcftcj1lsb150mldyjn5sh0000gn/T/
NVM_PATH=/Users/greg/.nvm/versions/node/v6.5.0/lib/node
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.jNLKBcDJTX/Render
TERM_PROGRAM_VERSION=388.1.1
TERM_SESSION_ID=E845D49D-9C60-4CEA-8777-19F521ED83A1
NVM_DIR=/Users/greg/.nvm
USER=greg
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.0CA6ZcRBJQ/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x52
NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist
PWD=/Users/greg/dev/ocaml
EDITOR=emacs
LANG=en_CA.UTF-8
NODE_PATH=./src
XPC_FLAGS=0x0
NODE_ENV=development
XPC_SERVICE_NAME=0
HOME=/Users/greg
SHLVL=1
LOGNAME=greg
NVM_BIN=/Users/greg/.nvm/versions/node/v6.5.0/bin
NVM_IOJS_ORG_MIRROR=https://iojs.org/dist
PROMPT_COMMAND=set_tab_title
_=/usr/local/bin/opam
OPAM_PACKAGE_VERSION=1.7.3-1
OPAM_PACKAGE_NAME=ocamlfind
MAKELEVEL=
MAKEFLAGS=

我没有太多可以继续调试的东西。关于从这里去哪里有什么建议吗?

opam 的这个 github 问题使我找到了一个对我有用的解决方案:https://github.com/ocaml/opam-repository/issues/10064

github 问题的解决方案是用户在他们的 $PATH 中有本地目录 .,这导致错误的 install 命令是 运行。这不是我的问题,但我的路径中有一个额外的 :

/Users/greg/.nvm/versions/node/v6.5.0/bin::/opt/chefdk/bin:/usr/local/mysql/bin:/usr/local/share/npm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

根据下面的评论,路径字符串中连续有两个冒号会将空字符串添加为路径的一部分,该路径被解释为当前目录。

删除多余的冒号可使 ocamlfind 安装成功。