1

我正在尝试运行 js_of_eliom,但它似乎没有 ppx_deriving 这是我在制作时收到的消息:

js_of_eliom -ppx -c -package lwt -package js_of_ocaml.deriving -package js_of_ocaml.ppx  simple_pomodoro.eliom
Fatal error: exception Fl_package_base.No_such_package("js_of_ocaml.ppx", "")
make: *** [_client/simple_pomodoro.cmo] Error 2

当我执行 ocamlfind 查询 js_of_ocaml.ppx 时,我得到了这个:

ocamlfind: Package `js_of_ocaml.ppx' not found

但我已经安装了 ppx_deriving,opam 列表显示它:

ppx_deriving           3.3  Type-driven code generation for OCaml >=4.02

我正在使用 el capitan(10.11) 在 mac osx 中运行,知道为什么会这样吗?

编辑

哦,对不起,我还安装了 js_of_ocaml,这出现在我的 ocamlfind 中:

λ ~/ ocamlfind list | grep js_of_ocaml
js_of_ocaml         (version: 2.7)
js_of_ocaml.compiler (version: [distributed with js_of_ocaml])
js_of_ocaml.compiler.with_findlib (version: n/a)
js_of_ocaml.deriving (version: [distributed with js_of_ocaml])
js_of_ocaml.deriving.ppx (version: [distributed with js_of_ocaml])
js_of_ocaml.deriving.syntax (version: [distributed with js_of_ocaml])
js_of_ocaml.graphics (version: [distributed with js_of_ocaml])
js_of_ocaml.log     (version: [distributed with js_of_ocaml])
js_of_ocaml.ocamlbuild (version: [distributed with js_of_ocaml])
js_of_ocaml.syntax  (version: [distributed with js_of_ocaml])
js_of_ocaml.toplevel (version: [distributed with js_of_ocaml])
js_of_ocaml.tyxml   (version: [distributed with js_of_ocaml])
js_of_ocaml.weak    (version: [distributed with js_of_ocaml])
4

2 回答 2

0

ppx_deriving是一个驱动程序,它管理不同的派生程序。它本身不提供任何东西。您需要安装js_of_ocaml派生程序,它是js_of_ocaml包的一部分:

opam install js_of_ocaml

结果,您将拥有它:

$ ocamlfind list | grep js_of_ocaml.ppx
js_of_ocaml.ppx     (version: [distributed with js_of_ocaml])
js_of_ocaml.ppx.internal (version: [distributed with js_of_ocaml])
于 2016-04-07T16:22:34.233 回答
0

我通过 github https://github.com/ocsigen/eliom/issues/251在 ocsigen 问题报告中找到了解决方案

我这样做了:

  • 我已经重新安装 opam (v.1.2.2),重新初始化,安装 4.02.3,utop & eliom。它仍然无法正常工作。然后我安装了 deriving_ppx.3.0.0,正如您在 SO 中已经提到的那样,现在它工作正常。谢谢 !
于 2016-04-12T14:20:22.293 回答