There have been a few people on IRC talking about having issues installing Nim and Nimble on OS X using Homebrew. I've managed to get it working for now by cheating slightly. Here are the steps:
brew install nim
sudo ln -s /usr/local/Cellar/nim/0.14.2/nim/lib /usr/local/lib/nim
git clone https://github.com/nim-lang/nimble.git ~/nimble
cd nimble
nim -d:release c -r src/nimble -y install
Then just add $HOME/nimble to your $PATH in your .bashrc (or .zshrc or whatever).
The important bit is the symlink (step 2). Nim/Nimble looks in /usr/local/lib for the libraries, but Homebrew doesn't install them there. A symlink is the easiest solution, though you will have to update it if/when you update Nim.
Afaik you do not need the symlink. It may even harm. I still regard homebrew Nim as a bad way to install Nim until it stabilizes.
Nim uses the std lib by using the path the Nim binary is located. Thats also why nim-vm easily can install and maintain multiple versions of Nim.
Installing Nimble works just as described in the docs in https://github.com/nim-lang/nimble in the Unix section.
@OderWat the symlink is the easiest solution. Without it, Nimble installation will fail, saying it's unable to find a library as it looks under /usr/local/lib/nim which doesn't exist.
Installing from source is definitely the best way to do it, but Homebrew is the easiest.
Well I think that nim-vm is easy enough and one does not run into these problems. It is not the first time that the homebrew package has problems. The symlink is the easiest fix but I think it is hardly a solution to symlink a folder into the Cellar of homebrew. The package could do that itself if the Nim release in the package needs this to work.
You state that "Nimble/Nim" looks into /usr/local/lib/nim which is not the full picture. It first looks into "/usr/local/Cellar/nim/0.14.2/bin/../lib/" (the lib dir above the bin dir in which the Nim compilers first softling location is). But there is no "lib" because the homebrew package layout is like this:
/usr/local/bin/nim -> /usr/local/Cellar/nim/0.14.2/bin/nim # softlink 1
/usr/local/Cellar/nim/0.14.2/bin/nim # softlink 2
/usr/local/Cellar/nim/0.14.2/bin/nimrod # well.. not really usefull
/usr/local/Cellar/nim/0.14.2/nim/bin/nim # real executable
/usr/local/Cellar/nim/0.14.2/nim/lib/ # stdlib
The real fix for the homebrew Nim is not to add the link from /usr/local/lib/nim to the cellar but to replace the indirect softlink link with a direct one:
rm /usr/local/bin/nim
ln -s /usr/local/Cellar/nim/0.14.2/nim/bin/nim /usr/local/bin/nim
Try it. You won't need the /usr/local/lib/nim one anymore and stuff works as it is supposed to work.
Please understand, that I reported a problem like that to homebrew before and was told that "nobody" is maintainer of the Nim package and that it is kinda the fault of the Nim author if it does not work. As contributor to nim-vm I also don't care to much as using the virtualizer is superior anyway.