larsch / ocra

One-Click Ruby Application Builder
http://ocra.rubyforge.org/
833 stars 84 forks source link

Ocra with FxRuby #173

Closed Genie23 closed 3 years ago

Genie23 commented 3 years ago

Hello,

I have a problem packaging a program written with FxRuby: when I run my program from the command line, everything works. When I use OCRA to package my program, it opens correctly, I use it thoroughly to include everything without any problem, and OCRA creates the executable for me, and this is what the ocra command I use returns :

=== Loading script to check dependencies
=== Attempting to trigger autoload of HexaPDF::Font::Type1::Font
=== Attempting to trigger autoload of HexaPDF::Font::Type1::PFBParser
=== Attempting to trigger autoload of HexaPDF::Font::Type1::AFMParser
=== Attempting to trigger autoload of HexaPDF::Layout::TextLayouter
=== Attempting to trigger autoload of HexaPDF::Layout::Frame
=== Attempting to trigger autoload of HexaPDF::Layout::TextBox
=== Attempting to trigger autoload of HexaPDF::Layout::ImageBox
=== Attempting to trigger autoload of HexaPDF::Font::Encoding::MacExpertEncoding
=== Attempting to trigger autoload of HexaPDF::Font::Encoding::SymbolEncoding
=== Attempting to trigger autoload of HexaPDF::Font::Encoding::ZapfDingbatsEncoding
=== Attempting to trigger autoload of HexaPDF::Font::Encoding::MacRomanEncoding
=== Attempting to trigger autoload of HexaPDF::Font::Encoding::DifferenceEncoding
=== Attempting to trigger autoload of HexaPDF::Font::Encoding::StandardEncoding
=== Attempting to trigger autoload of HexaPDF::Font::Encoding::WinAnsiEncoding
=== Attempting to trigger autoload of HexaPDF::FontLoader::FromConfiguration
=== Attempting to trigger autoload of HexaPDF::FontLoader::Standard14
=== Attempting to trigger autoload of HexaPDF::ImageLoader::PNG
=== Attempting to trigger autoload of HexaPDF::ImageLoader::PDF
=== Attempting to trigger autoload of HexaPDF::ImageLoader::JPEG
=== Attempting to trigger autoload of HexaPDF::Font::CMap::Writer
=== Attempting to trigger autoload of HexaPDF::Font::CMap::Parser
=== Attempting to trigger autoload of HexaPDF::Document::Images
=== Attempting to trigger autoload of HexaPDF::Document::Files
=== Attempting to trigger autoload of HexaPDF::Document::Fonts
=== Attempting to trigger autoload of HexaPDF::Composer
=== Attempting to trigger autoload of HexaPDF::Filter::PassThrough
=== Attempting to trigger autoload of HexaPDF::Filter::Encryption
=== Attempting to trigger autoload of HexaPDF::Filter::ASCIIHexDecode
=== Attempting to trigger autoload of HexaPDF::Filter::Crypt
=== Attempting to trigger autoload of HexaPDF::Filter::ASCII85Decode
=== Attempting to trigger autoload of HexaPDF::Filter::LZWDecode
=== Attempting to trigger autoload of HexaPDF::Filter::RunLengthDecode
=== Attempting to trigger autoload of HexaPDF::Content::GraphicObject::EndpointArc
=== Attempting to trigger autoload of HexaPDF::Content::GraphicObject::SolidArc
=== Attempting to trigger autoload of HexaPDF::Content::GraphicObject::Geom2D
=== Attempting to trigger autoload of HexaPDF::Content::GraphicObject::Arc
=== Attempting to trigger autoload of HexaPDF::Type::Annotation
=== Attempting to trigger autoload of HexaPDF::Type::FontType3
=== Attempting to trigger autoload of HexaPDF::Type::AcroForm
=== Attempting to trigger autoload of HexaPDF::Type::Action
=== Attempting to trigger autoload of HexaPDF::Type::EmbeddedFile
=== Attempting to trigger autoload of HexaPDF::Type::XRefStream
=== Attempting to trigger autoload of HexaPDF::Type::ObjectStream
=== Attempting to trigger autoload of HexaPDF::Type::ViewerPreferences
=== Attempting to trigger autoload of HexaPDF::Type::Names
=== Attempting to trigger autoload of HexaPDF::Type::FileSpecification
=== Attempting to trigger autoload of HexaPDF::Type::IconFit
=== Attempting to trigger autoload of HexaPDF::Type::Actions::GoTo
=== Attempting to trigger autoload of HexaPDF::Type::Actions::GoToR
=== Attempting to trigger autoload of HexaPDF::Type::Actions::Launch
=== Attempting to trigger autoload of HexaPDF::Type::Actions::URI
=== Attempting to trigger autoload of HexaPDF::Task::Optimize
=== Attempting to trigger autoload of HexaPDF::Task::Dereference
=== Attempting to trigger autoload of HexaPDF::Type::Annotations::Text
=== Attempting to trigger autoload of HexaPDF::Type::Annotations::Link
=== Attempting to trigger autoload of HexaPDF::Type::Annotations::Widget
=== Attempting to trigger autoload of HexaPDF::Encryption::SecurityHandler
=== Attempting to trigger autoload of HexaPDF::Encryption::ARC4
=== Attempting to trigger autoload of HexaPDF::Encryption::AES
=== Attempting to trigger autoload of HexaPDF::Encryption::FastARC4
=== Attempting to trigger autoload of HexaPDF::Encryption::RubyARC4
=== Attempting to trigger autoload of HexaPDF::Encryption::FastAES
=== Attempting to trigger autoload of HexaPDF::Encryption::RubyAES
=== Attempting to trigger autoload of HexaPDF::Encryption::Identity
=== Attempting to trigger autoload of HexaPDF::Encryption::StandardSecurityHandler
=== Attempting to trigger autoload of HexaPDF::Layout::Frame::SortedList
=== Attempting to trigger autoload of Geom2D::Segment
=== Attempting to trigger autoload of Geom2D::Algorithms
=== Attempting to trigger autoload of Geom2D::BoundingBox
=== Attempting to trigger autoload of Geom2D::Point
=== Attempting to trigger autoload of Geom2D::PolygonSet
=== Attempting to trigger autoload of Geom2D::VERSION
=== Attempting to trigger autoload of HexaPDF::Font::TrueType::Optimizer
=== Attempting to trigger autoload of HexaPDF::Font::TrueType::Font
=== Attempting to trigger autoload of HexaPDF::Font::TrueType::Subsetter
=== Attempting to trigger autoload of HexaPDF::Type::AcroForm::ChoiceField
=== Attempting to trigger autoload of HexaPDF::Type::AcroForm::SignatureField
=== Attempting to trigger autoload of HexaPDF::Type::AcroForm::Form
=== Attempting to trigger autoload of HexaPDF::Type::AcroForm::TextField
=== Attempting to trigger autoload of HexaPDF::Type::AcroForm::ButtonField
=== Attempting to trigger autoload of HexaPDF::Font::TrueType::Table::Hmtx
=== Attempting to trigger autoload of HexaPDF::Font::TrueType::Table::Loca
=== Attempting to trigger autoload of HexaPDF::Font::TrueType::Table::Maxp
=== Attempting to trigger autoload of HexaPDF::Font::TrueType::Table::Post
=== Attempting to trigger autoload of HexaPDF::Font::TrueType::Table::Glyf
=== Attempting to trigger autoload of HexaPDF::Font::TrueType::Table::OS2
=== Attempting to trigger autoload of HexaPDF::Font::TrueType::Table::Kern
=== Attempting to trigger autoload of HexaPDF::Font::TrueType::Table::Name
=== Attempting to trigger autoload of HexaPDF::Font::TrueType::Table::Directory
=== Attempting to trigger autoload of HexaPDF::Font::TrueType::Table::Head
=== Attempting to trigger autoload of HexaPDF::Font::TrueType::Table::Cmap
=== Attempting to trigger autoload of HexaPDF::Font::TrueType::Table::Hhea
=== Attempting to trigger autoload of Geom2D::Algorithms::PolygonOperation
=== Scanning Gemfile
=== Detected gem bundler-2.2.16 (scripts, files, extras)
===     2 files, 1572 bytes
=== Detected gem cmdparse-3.0.7 (scripts, files, extras)
===     22 files, 205315 bytes
=== Detected gem mini_portile2-2.5.0 (scripts, files, extras)
===     44 files, 83238 bytes
=== Detected gem fxruby-1.6.44-x64-mingw32 (scripts, files, extras)
===     1386 files, 90664359 bytes
=== Detected gem geom2d-0.3.1 (scripts, files, extras)
===     35 files, 94459 bytes
=== Detected gem hexapdf-0.15.0 (scripts, files, extras)
===     701 files, 7189400 bytes
=== Detected gem ocra-1.3.11 (scripts, files, extras)
===     12 files, 347630 bytes
=== Detected gem fiddle-1.0.6 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem did_you_mean-1.5.0 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem tsort-0.1.0 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem uri-0.10.1 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem stringio-3.0.0 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem date-3.1.0 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem time-0.1.0 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem strscan-3.0.0 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem digest-3.0.0 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem delegate-0.2.0 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem weakref-0.1.1 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem io-wait-0.1.0 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem zlib-1.1.0 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem forwardable-1.3.2 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem set-1.0.1 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem securerandom-0.1.0 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem openssl-2.2.0 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem io-nonblock-0.1.0 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem ipaddr-1.2.2 (scripts, files, extras)
===     0 files, 0 bytes
=== Detected gem pathname-0.1.0 (scripts, files, extras)
===     0 files, 0 bytes
=== Including 61 encoding support files (3644416 bytes, use --no-enc to exclude)
=== Will include all ruby core libraries
=== Building PDF Assembler.exe
=== Adding user-supplied source files
=== Adding ruby executable ruby.exe
=== Adding detected DLL C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fxruby-1.6.44-x64-mingw32/ports/x86_64-w64-mingw32/bin/libfxscintilla-20.dll
=== Adding detected DLL C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fxruby-1.6.44-x64-mingw32/ports/x86_64-w64-mingw32/bin/libFOX-1.6-0.dll
=== Adding detected DLL C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fxruby-1.6.44-x64-mingw32/ports/x86_64-w64-mingw32/bin/libstdc++-6.dll
=== Adding detected DLL C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fxruby-1.6.44-x64-mingw32/ports/x86_64-w64-mingw32/bin/libjpeg-62.dll
=== Adding detected DLL C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fxruby-1.6.44-x64-mingw32/ports/x86_64-w64-mingw32/bin/libpng16-16.dll
=== Adding detected DLL C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fxruby-1.6.44-x64-mingw32/ports/x86_64-w64-mingw32/bin/libtiff-5.dll
=== Adding detected DLL C:/Ruby30-x64/bin/ruby_builtin_dlls/libssl-1_1-x64.dll
=== Adding detected DLL C:/Ruby30-x64/bin/ruby_builtin_dlls/libcrypto-1_1-x64.dll
=== Adding external manifest C:/Ruby30-x64/bin/ruby_builtin_dlls/ruby_builtin_dlls.manifest
=== Adding supplied DLL ruby_builtin_dlls\libssp-0.dll
=== Adding supplied DLL ruby_builtin_dlls\libgmp-10.dll
=== Adding supplied DLL ruby_builtin_dlls\libgcc_s_seh-1.dll
=== Adding supplied DLL ruby_builtin_dlls\libwinpthread-1.dll
=== Adding library files
=== Compressing 135608448 bytes

LZMA 19.00 (x86) : Igor Pavlov : Public domain : 2019-02-21

Input size:  135608448 (129 MiB)
Output size: 18090838 (17 MiB)
=== Finished building PDF Assembler.exe (18158442 bytes)

And the command in question (there is no missing file, image or ruby in the list that I pass to OCRA) :

ocra --console --chdir-first --gem-full --add-all-core --gemfile Gemfile --output "PDF Assembler.exe" --icon Logo.64x64.ico --dll ruby_builtin_dlls\libssp-0.dll --dll ruby_builtin_dlls\libgmp-10.dll --dll ruby_builtin_dlls\libgcc_s_seh-1.dll --dll ruby_builtin_dlls\libwinpthread-1.dll pdfAssembler.rbw PdfAssemblerDatas.rb PdfAssemblerFile.rb PdfAssemblerFileRotationWindow.class.rbw PdfAssemblerMainWindow.class.rbw PdfAssemblerMdiWindow.class.rbw add.32x32.png arrow-down.32x32.png arrow-up.32x32.png copyright.16x16.png empty.32x32.png empty.64x64.png gears.35x32.png Logo.16x16.png Logo.64x64.png Logo_title.600x120.png rotation_0.128x128.png rotation_90.128x128.png rotation_180.128x128.png rotation_270.128x128.png

But then, when I open the executable (well when I call it from the console, I used the --console option so that it returns the errors to me at runtime) I get these errors :

<internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': 126: Le module spÚcifiÚ est introuvable.   - C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/gems/3.0.0/gems/fxruby-1.6.44-x64-mingw32/lib/3.0/fox16_c.so (LoadError)
        from <internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/gems/3.0.0/gems/fxruby-1.6.44-x64-mingw32/lib/fox16.rb:27:in `block in <top (required)>'
        from C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/gems/3.0.0/gems/fxruby-1.6.44-x64-mingw32/lib/fox16.rb:16:in `rescue in block in <top (required)>'
        from C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/gems/3.0.0/gems/fxruby-1.6.44-x64-mingw32/lib/fox16.rb:10:in `block in <top (required)>'
        from C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/gems/3.0.0/gems/fxruby-1.6.44-x64-mingw32/lib/fox16.rb:26:in `rescue in <top (required)>'
        from C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/gems/3.0.0/gems/fxruby-1.6.44-x64-mingw32/lib/fox16.rb:1:in `<top (required)>'
        from <internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `require'
        from <internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
        from <internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in `require'
        from C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/src/pdfAssembler.rbw:11:in `<main>'
<internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': 126: Le module spÚcifiÚ est introuvable.   - C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/3.0.0/x64-mingw32/fiddle.so (LoadError)
        from <internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/3.0.0/fiddle.rb:3:in `<top (required)>'
        from <internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/dll_directory.rb:1:in `<top (required)>'
        from <internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/singleton.rb:12:in `add_dll_directory'
        from C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/gems/3.0.0/gems/fxruby-1.6.44-x64-mingw32/lib/fox16.rb:12:in `block in <top (required)>'
        from C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/gems/3.0.0/gems/fxruby-1.6.44-x64-mingw32/lib/fox16.rb:26:in `rescue in <top (required)>'
        from C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/gems/3.0.0/gems/fxruby-1.6.44-x64-mingw32/lib/fox16.rb:1:in `<top (required)>'
        from <internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `require'
        from <internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
        from <internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in `require'
        from C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/src/pdfAssembler.rbw:11:in `<main>'
<internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- fox16_c (LoadError)
        from <internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/gems/3.0.0/gems/fxruby-1.6.44-x64-mingw32/lib/fox16.rb:2:in `<top (required)>'
        from <internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `require'
        from <internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
        from <internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in `require'
        from C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/src/pdfAssembler.rbw:11:in `<main>'
<internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- fox16 (LoadError)
        from <internal:C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from C:/Users/sphin/AppData/Local/Temp/ocrD19.tmp/src/pdfAssembler.rbw:11:in `<main>'

And at the start of my script, I call my two gems FxRuby and HexaPDF with very simple require :

require "fox16"
require "fox16/colors"
require "hexapdf"
include Fox

What am I doing wrong with using OCRA ?

Genie23 commented 3 years ago

Hello,

Thanks to the help of a French-speaking community, I was able to solve my problem. I was just missing a DLL to add manually to my command line.

The DLL I was missing, to make my FxRuby application work after packaging, was ruby_builtin_dlls\zlib1.dll. Now that it is added, my generated executable works normally.