Asciidoctor-pdf and Atom error 'asciidoctor-pdf.bat' is not recognized

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Asciidoctor-pdf and Atom error 'asciidoctor-pdf.bat' is not recognized

Luke
Hi

Merry Christmas and a happy New Year!

Can someone please point me in the right direction.  I am not a developer and I'm in over my head but willing to learn!  I know just enough to get myself in trouble ;-)

I receive the above error when using the right click (AsciiDoc: Export as PDF) option in Atom.  I don't know where to look to trouble shoot it.

The full error message is "'asciidoctor-pdf.bat' is not recognized as an internal or external command, operable program or batch file."


The details:
- Its a work computer.  Windows 8.1 64bit.
- 'Documents folder' redirects to a network drive somewhere
- I have successfully installed
  - Atom (in users folder on this machine)
  - asciidoc-assistant
  - asciidoc-image-helper
  - asciidoc-preview
  - autocomplete-asciidoc
 - language-asciidoc
- Git

I have enabled the options in "Always enable AsciiDoctor experimental extensions", "Use asciidoctor-pdf" and "automatically open the PDF after generation with the default PDF viewer"

I have installed Ruby, and all the recommended gems.  I can successfully produce a PDF from the command line from a *.adoc file. So I think my base configuration is correct.

Any direction you can provide will be greatly appreciated.

Thanks in advance
Luke
Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor-pdf and Atom error 'asciidoctor-pdf.bat' is not recognized

mojavelinux
Administrator
Luke,

My guess is that while you have Ruby working on the commandline, that environment is not visible to Atom. It might be helpful if the Atom plugin printed the Ruby environment if it fails to execute asciidoctor-pdf so it's possible to diagnosis the environment.

I realize getting this setup in Atom on Windows is tricky at the moment. If someone has setup that combination, your input would be appreciated.

Cheers,

-Dan

On Wed, Dec 28, 2016 at 5:16 PM, Luke [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi

Merry Christmas and a happy New Year!

Can someone please point me in the right direction.  I am not a developer and I'm in over my head but willing to learn!  I know just enough to get myself in trouble ;-)

I receive the above error when using the right click (AsciiDoc: Export as PDF) option in Atom.  I don't know where to look to trouble shoot it.

The full error message is "'asciidoctor-pdf.bat' is not recognized as an internal or external command, operable program or batch file."


The details:
- Its a work computer.  Windows 8.1 64bit.
- 'Documents folder' redirects to a network drive somewhere
- I have successfully installed
  - Atom (in users folder on this machine)
  - asciidoc-assistant
  - asciidoc-image-helper
  - asciidoc-preview
  - autocomplete-asciidoc
 - language-asciidoc
- Git

I have enabled the options in "Always enable AsciiDoctor experimental extensions", "Use asciidoctor-pdf" and "automatically open the PDF after generation with the default PDF viewer"

I have installed Ruby, and all the recommended gems.  I can successfully produce a PDF from the command line from a *.adoc file. So I think my base configuration is correct.

Any direction you can provide will be greatly appreciated.

Thanks in advance
Luke



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Asciidoctor-pdf-and-Atom-error-asciidoctor-pdf-bat-is-not-recognized-tp5179.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctor-pdf and Atom error 'asciidoctor-pdf.bat' is not recognized

abelsromero
Same setup is working for me (Win 7) and I could reproduce the issue by removing by Ruby directory from the system PATH.
I image that for some reason, either ATOM is not inheriting the environment variables or something in your environment is not right. Also, could be that in your installation, the .bat executable is not visible or created during the gem installation.

If you're willing to learn we can try to see what's going on, first thing is checking teh .bat and the environment variables.

  1. Check ".bat" visibility. Normally Windows runs a .bat/.cmd when you don't type the extension. Can you try to run a conversion from shell  using "asciidoctor-pdf.bat" instead of just "asciidoctor"? If this doesn't work, see what launching scripts are created in your Ruby installation folder. In my "Ruby23-x64\bin" I have: asciidoctor.bat, asciidoctor, asciidoctor-pdf.bat, asciidoctor-pdf, asciidoctor-safe.bat, asciidoctor-safe, etc... you see the pattern.

  2. To check Windows environment variables: Open a "cmd" shell and type SET: check that the "PATH" variable includes your path to the Ruby installation, in my case is "C:\Ruby23-x64\bin".

  3. To check Atom'senvironment variables:
DISCLAIMER: This is NOT a nice approach, but I am not much versed in Js/CoffeScript and this is the simplest way I found to see the environment used in Atom.
  - Go to your atom folder
  - Browse to "packages\asciidoc-preview\lib"
  - Open "pdf-converter.coffee" in a good text editor, you can use Atom itself.
  - Change line 47: replace 'asciidoctor-pdf.bat' by 'SET' (quotes included).
  - Close & reopen atom and execute the render: you'll get the environment variables in a popup, copy it and compare with the one from step 1.
If the path to the ruby installation is not here, we know that's the issue.

Note that I am using the Ruby for Windows installer https://rubyinstaller.org/, it's simple and it works. I tried using other packaged like the one include in Babun and need some tweaking.