问题
I'm trying to create a portable version of a Ruby script with Ocra. The script depends upon rmagick
which requires ImageMagick to be installed as well.
The produced executable works on my computer but it fails on every other computer unless the end user installs ImageMagick manually. I would like to create a fully portable EXE file that runs on any Windows system and doesn't require the end user to install ImageMagick manually.
Is there a way to force Ocra to bundle the ImageMagick DLL files into the EXE as well? If not, how do you create portable Ruby scripts that require rmagick
?
I'm not fluent in Ruby at all so any help would be appreciated.
回答1:
From the 'ocra --help' output:
Packaging options:
--dll dllname Include additional DLLs from the Ruby bindir.
In other words, copy the dll to ruby bindir and do: ocra -dll imagemagick.x.x.x.dll myscript.rb
回答2:
you can package external DLLs simply appending them at the end of the ocra command, e.g.
ocra myscript.rb rmagick.dll
来源:https://stackoverflow.com/questions/10059254/bundling-rmagick-with-ocra