[英]“Could not find module ‘Yi’” when launching Yi Editor
我已使用Stack(具有全局设置)成功安装了Yi Editor。
- OS X El Capitan 10.11.5
- 堆栈1.1.0(LTS 6.7)
我将以下配置文件放在〜/ .config / yi / yi.hs。
import Yi
main = putStrLn "It works."
然后,我跑了yi
并在“ ***** error **”窗格中出现以下错误。
/Users/kakkun61/.config/yi/yi.hs:1:8:
Could not find module ‘Yi’
Use -v to see a list of the files searched for.
我该如何解决? Yi Editor在哪里找到库?
PS yi
没有-v
选项。
$ yi -v
yi: unrecognized option `-v'
使用stack exec yi
。 如果要向Yi添加选项,请使用stack exec -- yi --foo
。
$ stack exec yi
Run from outside a project, using implicit global project config
Using resolver: lts-6.7 from implicit global project's config file: /Users/kakkun61/.stack/global-project/stack.yaml
Configuration '/Users/kakkun61/.config/yi/yi.hs' changed. Recompiling.
Program reconfiguration successful.
Launching custom binary /Users/kakkun61/.cache/yi/yi-darwin-x86_64
It works.
使用堆栈
这对我来说适用于堆栈:
$ git clone https://github.com/yi-editor/yi.git
$ cd yi
$ cabal get Hclip
...create a stack.yaml file...
$ stack build
$ stack exec yi
stack.yaml文件包含:
resolver: lts-6.0
packages:
- '.'
- 'Hclip-3.0.0.4'
注意:在stack build
之后,我尝试了stack install
而stack exec yi
停止了工作-因此不要运行stack install
。
使用阴谋沙箱
我能够使用cabal沙盒安装它:
$ git clone https://github.com/yi-editor/yi.git
$ cd yi
$ cabal sandbox init
$ cabal install --only-dependencies
$ cabal install
$ cabal exec yi
修改yi.hs
也可以:
$ cp example-configs/yi-simple.hs ~/.config/yi/yi.hs
$ cabal exec yi
要设置一个脚本,以便您可以从任何目录运行yi,请使用:
#!/bin/sh
YI_DIR=...
env CABAL_SANDBOX_CONFIG=$YI_DIR/cabal.sandbox.config cabal exec yi -- "$@"
这里YI_DIR
是包含cabal.sandbox.config文件的目录。
请注意,这些说明与以下位置的说明几乎相同:
http://yi-editor.github.io/pages/installing/#InstallinginsideaCabalsandbox
除了使用cabal exec
调用yi的方式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.