choosenim-init: ChooseNim installed in /Users/zhenxingsun/.nimble/bin choosenim-init: You must now ensure that the Nimble bin dir is in your PATH. choosenim-init: Place the following line in the ~/.profile or ~/.bashrc file. choosenim-init: export PATH=/Users/zhenxingsun/.nimble/bin:$PATH (base) zhenxingsun@ZhenxingdeMBP ~ % export PATH=/Users/zhenxingsun/.nimble/bin:$PATH (base) zhenxingsun@ZhenxingdeMBP ~ %
what should I do next to install nim successfully ?
These final lines hint that you should change your PATH environment variable. The way you should do this depends on your shell. I believe that the default shell by default on MacOS is zsh. You probably want to add the following line to your ~/.zshrc configuration file.
export PATH=/Users/zhenxingsun/.nimble/bin:$PATH
You should then either:
Without this line, the shell won't find the nimble executable. In any case, you can already code and compile in Nim.
You can check by compiling something simple:
import strformat
var age = stdin.readLine()
echo fmt"I am {age} years old!"
with nim r test.nimBy default MacOS uses zsh shell, so you can open "~/.zshrc" in any text editor and add this line at the end:
export PATH=/Users/zhenxingsun/.nimble/bin:$PATH
That would make the terminal and apps launched via terminal see nim and tools installed with nimble. For GUI apps to see nim, there must be a solution, but I'm not familiar with apple devices and resources online aren't helpful either.