0

我使用 Stack (使用全局设置)成功安装了 Yi Editor。

  • OS X 埃尔卡皮坦 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 在哪里找到图书馆?

PSyi没有-v选项。

$ yi -v
yi: unrecognized option `-v'
4

2 回答 2

2

使用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.
于 2016-07-25T08:28:49.943 回答
0

使用堆栈

这对我有用的堆栈:

$ 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 installstack 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

除了使用 调用 yi 的方式cabal exec

于 2016-07-25T03:51:50.780 回答