[SOLVED] Asciidoctor / asciidoc not found in $PATH

Hi,

I got a problem while launching hugo server with asciidoc files :
Building sites … ERROR 2018/01/15 16:04:33 asciidoctor / asciidoc not found in $PATH: Please install.
Leaving AsciiDoc content unrendered.

My asciidoc files are placed here : mysite/content
Asciidoctor / Asciidoc are installed (i followed : http://asciidoctor.org/docs/install-toolchain/)

My $PATH is good i think : /home/vagrant/bin:/home/vagrant/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/bin:/sbin:/bin/usr/games:/snap/bin

Hugo version :
Hugo Static Site Generator v0.32.4 linux/amd64 BuildDate: 2018-01-12T04:16:41Z

Asciidoctor version :
Asciidoctor 1.5.6.1 [http://asciidoctor.org]
Runtime Environment (ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)

Someone know about this issue ?

Thanks

There are 5 different ways - which one it is?
You did the distro repo way - yes? One of:

sudo apt-get install asciidoctor
sudo yum install asciidoctor
sudo dnf install asciidoctor

You show your $PATH - but not if asciidoctor actually is within the $PATH.
You get something like this?

$ which asciidoctor 
/usr/bin/asciidoctor

I used the gem installer :
gem install asciidoctor

which asciidoctor give me :
/usr/local/bin/asciidoctor

Thanks

Strange, I tried to reproduce - but not with gem.

$ which hugo
/usr/local/bin/hugo

$ hugo env
Hugo Static Site Generator v0.32.4 linux/amd64 BuildDate: 2018-01-11T09:58:37+01:00
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.9.2"

$ hugo server
Building sites … ERROR 2018/01/16 11:37:49 asciidoctor / asciidoc not found in $PATH: Please install.
                  Leaving AsciiDoc content unrendered.
...

$ sudo apt-get install asciidoctor   # debian based system
$ which  asciidoctor 
/usr/bin/asciidoctor
$ asciidoctor --version
Asciidoctor 1.5.4 [http://asciidoctor.org]
Runtime Environment (ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)

$ hugo server

=> no error

Anyone using the gem way?

Even with the apt-get install way, i got the same error.
Futhermore, it seem you have the same error :

$ hugo server
Building sites … **ERROR 2018/01/16 11:37:49 asciidoctor / asciidoc not found in $PATH: Please install.**
                  Leaving AsciiDoc content unrendered.
...

Is Hugo installed as a snap?

No - I was no clear; I did show how I solved the issue.

  1. showing the error (because no asciidoctor was installed)
  2. install asciidoctor
  3. error gone …

Ah - well done!
This throws the error. I can reproduce:
$ sudo snap install hugo

=>

$ /snap/bin/hugo server
Building sites … ERROR 2018/01/16 23:18:48 asciidoctor / asciidoc not found in $PATH: Please install.
                  Leaving AsciiDoc content unrendered.

$ /usr/local/bin/hugo server
# all OK

The /usr/local/bin/hugo executable (from the debian package) works well.
There is a note about the snap installation:

Looks like there are some downsides in using the snap installation:

Hugo-as-a-snap can write only inside the user’s $HOME directory—and gvfs-mounted directories owned by the user

But you get the auto update - which is nice.

I do:

wget https://github.com/gohugoio/hugo/releases/download/v0.32.4/hugo_0.32.4_Linux-64bit.deb
sudo dpkg -i hugo_0.32.4_Linux-64bit.deb 

(for debian based systems)

or even:

wget https://github.com/gohugoio/hugo/releases/download/v0.32.4/hugo_0.32.4_Linux-64bit.tar.gz -O -   | tar -xvz

or

curl https://github.com/gohugoio/hugo/releases/download/v0.32.4/hugo_0.32.4_Linux-64bit.tar.gz -L  | tar -xvz

No root access needed for the last 2 ones where you end up with having the hugo executable in the current directory (README.md and LICENSE.md as well).

use then
./hugo
to make sure you run the wanted executable

So if you want to use asciidoctor - do not use the snap installation for this project.
(Maybe someone with snap knowledge can jump in and advice …)

Snap architecture has limitations. It is a separate file system within the main OS.

So external applications cannot be launched from within the Hugo snap. Like editors etc

Hugo has a new concept called external helpers.

and:
https://gohugo.io/getting-started/installing#install-pygments-optional

So all those helpers are not accessible with a hugo snap installation ?

I know for sure that you cannot launch an editor with hugo new from the terminal when using the snap.

I haven’t tested what you ask me.

But as you said above, such limitations can be overcome by removing the snap and installing Hugo from a tar or deb. Of course then you will have to update manually with every release.

Indeed, it was a snap hugo’s version problem specific,
After reinstalling it with :
wget https://github.com/gohugoio/hugo/releases/download/v0.32.4/hugo_0.32.4_Linux-64bit.deb
sudo dpkg -i hugo_0.32.4_Linux-64bit.deb

problem solved,

Thanks guys, you rock !