Re: Cannot install prawn-gmagick
Posted by
mojavelinux on
Feb 13, 2020; 8:45pm
URL: https://discuss.asciidoctor.org/Cannot-install-prawn-gmagick-tp7637p7644.html
Thanks for sharing that breakdown, Abel!
I want to point out that prawn-gmagick is not required. It's an optimization to accelerate conversion. If it's too much trouble to install, I strongly recommend not trying to install it, or using the Docker image instead (
https://github.com/asciidoctor/docker-asciidoctor).
Cheers,
-Dan
On Thu, Feb 13, 2020 at 1:21 PM abelsromero [via Asciidoctor :: Discussion] <
[hidden email]> wrote:
I assume you mean this thread https://github.com/packetmonkey/prawn-gmagick/issues/9.
I just added a note sumarizing the process I followed on Windows 10.
Thing is some Ruby gems use what is called "native" components. In other words, C written code that needs to be compiled to the platform it runs (Windows, Linux, ...). On Linux this is easy since it comes with C/C++ compilation tools out-of-the-box, for Windows you need to install Mys2.
The step by step guide is as follows:
- Run `risk install`: this will install Msys2 (C compiler). If the command is not found in path, it is localted where you installed Ruby, just run form the directory. In the past I noticed sometimes the console sometimes hangs, if nothing appears for one minute or so, press enter to force a refresh.
- Install the required dev dependencies `mingw64/mingw-w64-x86_64-graphicsmagick` using the command `ridk.cmd exec pacman -S mingw64/mingw-w64-x86_64-graphicsmagick`. This is not the binary distribution, but the extra files required to compile prawn-gmagic native components. This will ask to install extra packages, say yes (Y).
- After that, just install the gem normally `gem install prawn-gmagick`. You will see in the console the message "Building native extensions. This could take a while..." and after that the normal installation messages.
If this does not work run "risk enable" first to setup the console (don't close the terminal). This step deppends on how you install MYS2, for me is not necessary.
I can imagine this seems like a big hustle, I hope this does not deter you with Asciidoctor. Having to compile native components is not common and Windows makes things a lot more complicated than other environments. If you can provide an example on some GitHub repo of what you want to achieve, it will be much easier for me or others to understand the issues and help you.
* Alternatively, you could try using WSDL or WSDL2 in Windows10, which will make building native components much easier.
--