'How to solve "ebook-convert" is not installed?

I want to convert .md into PDFs, and I followed https://toolchain.gitbook.com/ebook.html:

Download the Calibre application. After moving the calibre.app to your Applications folder create a symbolic link to the ebook-convert tool:

$ sudo ln -s ~/Applications/calibre.app/Contents/MacOS/ebook-convert /usr/bin

Then I got this:

HF:The-North-Book wonderful$ sudo ln -s ~/Applications/calibre.app/Contents/MacOS/ebook-convert /usr/bin
Password:
ln: /usr/bin/ebook-convert: File exists
HF:The-North-Book wonderful$ PATH
-bash: PATH: command not found
HF:The-North-Book wonderful$ gitbook pdf ./ ./mybook.pdf
info: 7 plugins are installed 
info: 6 explicitly listed 
info: loading plugin "highlight"... OK 
info: loading plugin "search"... OK 
info: loading plugin "lunr"... OK 
info: loading plugin "sharing"... OK 
info: loading plugin "fontsettings"... OK 
info: loading plugin "theme-default"... OK 
info: found 26 pages 
info: found 0 asset files 

InstallRequiredError: "ebook-convert" is not installed.
Install it from Calibre: https://calibre-ebook.com

While I do have installed calibre 2, so I don't know where the problem is.Can someone help me?



Solution 1:[1]

You can install it with homebrew:

brew install calibre --cask

If you don't have cask:

brew tap caskroom/cask

Then just use it normally

 ebook-convert ~/path_to/file.pdf ~/new_file_path/gen_file.pdf (options)

Solution 2:[2]

As of 2021, the answer to this question for me was that instead of

brew tap homebrew/cask

then

brew install --cask calibre

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Michal Šrůtek
Solution 2 wlixcc