前提・実現したいこと
Ruby/Tkのgemを用いたGUIプログラムを作成し、配布しようと思っておりまして、
ocraでexeファイル化しようとしたところ、exeファイルは作成されたのですが、
実行すると、以下エラーが発生してGUIがでてきません。(エラーコードは画像からテキスト化したので、読みづらくすみません)
エラーを見たところ、Tkのgemをプログラムが探し出せないように思えますが、ocra実行時にはしっかり、tkのgemはインクルードされているように思えます。
(自分は、tcltkライブラリをocraに詰めていなかったからエラーしたのではないかと推測しております。)
色々調べたところ、ocraはtkと相性が良くないようですが、うまく、exe化できる方法をご教授いただければ幸いでございます。
発生している問題・エラーメッセージ
exe実行時エラー
Traceback(mostrecentcalllast): 4:fromC:/Users/homedir/AppData/Local/Temp/ocr7E1.tmp/src/tk.rb:1:in<main>' 3:fromC:/Users/homedir/AppData/Local/Temp/ocr7E1.tmp/src/tk.rb:1:in'require_relative' 2:fromC:/Users/homedir/AppData/Local/Temp/ocr7E1.tmp/src/common.rb:7:in'<top>'(required) 1:fromC:/Users/homedir/AppData/Local/Temp/ocr7E1.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in'require' C:/Users/homedir/AppData/Local/Temp/ocr7E1.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in'require':cannotloadsuchfile--tk(LoadError) 8:fromC:/Users/homedir/AppData/Local/Temp/ocrC709.tmp/src/tk.rb:1:in'main' 7:fromC:/Users/homedir/AppData/local/Temp/ocrC709.tmp/src/tk.rb:1:in'require_relative' 6:fromC:/Users/homedir/AppData/Local/Temp/ocrC709.tmp/src/common.rb:7:i n<top(required) 5:fromC:/Users/homedir/AppData/Local/Temp/ocrC709.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:34:in'require' 4:fromC:/Users/homedir/AppData/local/Temp/ocrC709.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in'rescue'in'require' 3:fromC:/Users/homedir/AppData/Local/Temp/ocrC709.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in'require' 2:fromC:/Users/homedir/AppData/local/Temp/ocrC709.tmp/lib/ruby/gems/2.6.0/gems/tk0.3.0/lib/tk.rb:7:in<top(required) 1:fromC:/Users/homedir/AppData/Local/Temp/ocrC709.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in'require' C:/Users/homedir/AppData/Local/Temp/ocrC709.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in'require':126:指定されたモジュールが見つかりません -C:/Users/homedir/AppData/Local/Temp/ocrC709.tmp/lib/ruby/gems/2.6.0/gems/tk0.3.0/lib/tcltklib.so(LoadError)
ocra実行時のログ
=== Loading script to check dependencies === Detected gem did you mean-1.3.0 (loaded, files) === 19 files, 20063 bytes == Detected gem ocra-1.3.11 (loaded, files) 5 files, 271800 bytes == Detected gem mini portile2-2.4.0 (loaded, files) 9 files, 8337 bytes === Detected gem nokogiri-1.10.10-x64-mingw32 (loaded, files) === 70 files, 18188251 bytes === Detected gem stringio-0.0.2 (loaded, files) === WARNING: Gem stringio-0.0.2 root folder was not found, skipping === Detected gem strscan-1.0.0 (loaded, files) === WARNING: Gem strscan-1.0.0 root folder was not found, skipping === Detected gem date-2.0.0 (loaded, files) === WARNING: Gem date-2.0.0 root folder was not found, skipping === Detected gem zlib-1.0.0 (loaded, files) === WARNING: Gem zlib-1.0.0 root folder was not found, skipping === Detected gem csv-3.0.9 (loaded, files) === WARNING: Gem csv-3.0.9 root folder was not found, skipping === Detected gem forwardable-1.2.0 (loaded, files) === WARNING: Gem forwardable-1.2.0 root folder was not found, skipping === Detected gem tk-0.3.0 (loaded, files) === 428 files, 3119524 bytes === Detected gem chi Idprocess-3.0.0 (loaded, files) 19 files, 41779 bytes === Detected gem rubyzip-2.3.0 (loaded, files) 37 files, 98615 bytes === Detected gem selenium-webdriver-3.142.7 (loaded, files) === 71 files, 1038371 bytes === Detected gem fcnt1-1.0.0 (loaded, files) === WARNING: Gem font-1.0.0 root folder was not found, skipping === Detected gem logger-1.3.0 (loaded, files) === WARNING: Gem logger-1.3.0 root folder was not found, skipping === Detected gem ffi-1.13.1-x64-mingw32 (loaded, files) === 83 files, 1094398 bytes === Detected gem fileutils-1.1.0 (loaded, files) === WARNING: Gem fileutils-1.1.0 root folder was not found, skipping === Detected gem etc-1.0.1 (loaded, files) === WARNING: Gem etc-1.0.1 root folder was not found, skipping === Detected gem json-2.1.0 (loaded, files) === WARNING: Gem json-2.1.0 root folder was not found, skipping === Detected gem ostruct-0.1.0 (loaded, files) === WARNING: Gem ostruct-0.1.0 root folder was not found, skipping === Including 59 encoding support files (3792896 bytes, use --no-end to exclude) === Building tk.exe === Adding user-supplied source files === Adding ruby executable ruby.exe === Adding detected DLL C:/Ruby26-x64/bin/ruby_builtin_dlls/libgmp-10.dll === Adding detected DLL C:/Ruby26-x64/bin/ruby built in dlls/libssp-0.dll === Adding detected DLL C:/Ruby26-x64/bin/ruby built in dlls/libffi-6.d||| === Adding detected DLL C:/Ruby26-x64/bin/ruby built in dlls/zlibl.dll === Adding detected DLL C:/Ruby26-x64/msys64/mingw64/bin/tc 186.d|| === Adding detected DLL C:/Ruby26-x64/msys64/mingw64/bin/tk86.dll === Adding detected DLL C:/Ruby26-x64/msys64/mingw64/lib/reg1.3/tclreg13.dll === Adding external manifest C:/Ruby26-x64/bin/ruby_builtin_dils/ruby_builtin_di Is.manifest === Adding library files === Compressing 46131109 bytes _ZMA 19.00 (x86) : Igor Pavlov : Public domain : 2019-02-21 Input size: 46131109 (43 MiB) Dutput size: 8208037 (7 MiB) === Finished building tk.exe (8258745 bytes)
該当のソースコード
ruby
1#tk.rb 2require_relative "common" 3 4#以下TKのコード 5 6#common.rb 7require "nokogiri" 8require "open-uri" 9require 'net/http' 10require "date" 11require "csv" 12require 'uri' 13require "tk" 14
補足情報(FW/ツールのバージョンなど)
windows7
ruby 2.6.5
tk 0.3.0
ocra 1.3.11
参考URL
http://blawat2015.no-ip.com/~mieki256/diary/201012221.html
https://github.com/larsch/ocra/issues/29
回答1件
あなたの回答
tips
プレビュー