我使用ghcup安装程序在MacOS系统上安装了Haskell。它之所以有效,是因为如果我键入ghci,我就会被放入这个交互式外壳中。然而,安装完成后,我在终端中收到了以下消息:
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'吗?
在macOS上,< code >。默认情况下,bashrc不存在。< code>ghcup将创建此文件,因此您运行的命令将正确运行。但是,< code>ghcup的一个子命令期望在创建文件之前找到该文件,因此报告了该错误消息。您可以放心地忽略这一点。