为什么`stack --version`似乎显示的版本与安装版本不同?

时间:2018-06-18 19:09:41

标签: linux bash haskell haskell-stack

我跑stack upgrade,似乎有效。输出到控制台说我有一个新的堆栈可执行文件,但stack --version说的不同。我错过了什么?

~
$ stack upgrade
Current Stack version: 1.3.2, available download version: 1.7.1
Newer version detected, downloading
Querying for archive location for platform: osx-x86_64-static
Querying for archive location for platform: osx-x86_64
Downloading from: https://github.com/commercialhaskell/stack/releases/download/v1.7.1/stack-1.7.1-osx-x86_64.tar.gz
Download complete, testing executable
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2
New stack executable available at /Users/skissh/.local/bin/stack
~
$ which stack
/Users/skissh/.local/bin/stack
~
$ stack --version
Version 1.3.2, Git revision 3f675146590da4f3edf768b89355f798229da2a5 (4395 commits) x86_64 hpack-0.15.0
~
$ cd ~/.local/bin
~/.local/bin
$ ls -l
total 64040
-rwxr-xr-x  1 skissh  staff  32788156 Jun 17 12:27 stack
~/.local/bin

1 个答案:

答案 0 :(得分:1)

正如@Thomas M. DuBuisson所说的,用hash -r可以解决这个问题。重新启动终端后,stack --version引用了新安装的可执行文件。我没有运行hash -r,但是我确实在新终端中运行hash,并且缓存已清除。