我试图在Ubuntu 16.04.3在VirtualBox上设置OCaml。我对他们都是新手;请原谅我的无知。我使用emacs ocaml REPL:“搜索程序:没有这样的文件或目录,ocaml”
wget https://raw.github.com/ocaml/opam/master/shell/opam_installer.sh -O - | sh -s /usr/local/bin
安装opam
,并根据以下的opam
安装说明添加
. /home/<username>/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
我~/.profile
文件。我使用opam install tuareg
和GNU emacs 24.5.1
使用sudo apt-get install emacs
来安装tuareg
。
当我试图在Emacs中键入M-x run-ocaml
和return
使用ocaml
REPL,我OCaml REPL to run: ocaml
;当我再次打enter
,我
Searching for program: no such file or directory, ocaml
然后我试图M-x shell
,看看我是否可以运行外壳ocaml
,我发现我需要使用opam switch
我想从终端/ shell中运行ocaml
每次;如果我直接键入ocaml
,我会得到
The program 'ocaml' is currently not installed. You can install it by typing: sudo apt-get install ocaml-interp
我不知道这是否有什么关系,我发现了问题。
作为第二次尝试,我又回到了Emacs和类型M-x run-ocaml
,打return
,并在OCaml REPL to run:
再次命中return
(这次没有ocaml
)。这开辟了一个新的缓冲区:
但是,当我试图在新的缓冲区类的东西,说1+1;;
,并创下shift-return
,我得到Output file descriptor of OCaml is closed
,如上图所示。
我一直在阅读不同的文档和线索的指示,但他们都没有描述我的情况。任何帮助将非常感激!