【发布时间】:2021-07-05 03:30:05
【问题描述】:
我使用 ghcup 安装程序在我的 MacOS 系统上安装了 Haskell。它之所以有效,是因为如果我输入 ghci,我就会掉入这个交互式 shell。但是我在安装后在终端收到了这条消息:
In order to run ghc and cabal, you need to adjust your PATH variable.
You may want to source '/Users/user1/.ghcup/env' in your shell
configuration to do so (e.g. ~/.bashrc).
Detected bash shell on your system...
If you want ghcup to automatically add the required PATH variable to "/Users/user1/.bashrc"
answer with YES, otherwise with NO and press ENTER.
YES
grep: /Users/user1/.bashrc: No such file or directory
我的 shell 是 bash 3.2 但正如你所看到的,当我输入 YES 时,它说没有这样的文件。如何找到我的 shell 配置文件,或解决这个问题?我想在这里正确完成设置。 而且我必须诚实地说我在这里的知识水平,我并不真正理解这到底在问什么。 PATH 变量是“env”吗?
【问题讨论】:
-
您的系统上是否存在文件
/Users/user1/.bashrc? -
另外,关于您关于
env/PATH的问题:PATH是一个环境变量,将包含文件夹列表。env是一个命令,它将查找PATH中列出的每个文件夹并检索可用的程序 -
是的,它在文件存在时返回。但是 ghcup 没看到?
-
在我看来它有效。如果您仍然无法启动您的命令,您可以查看stackoverflow.com/questions/51876792/…。否则,你很高兴
-
Osx 不提供默认的 bashrc 配置。您可以从this question 获得第二个答案作为灵感,并在其末尾复制您当前拥有的代码sn-p