rubywindows-7windows-10tk-toolkitocra

Ruby executable won't start on Win10 and Win7


I wrote a ruby application with Tk, and everything is fine, no errors or such. So i made an exe with Ocra and i had some problems at the start but then i solved, Ocra made the exe with no errors and also when it let's you try your script before conpiling it, there were no problems.

But then when i double clicked the exe, nothing. I waited, and nothing.. Run it as admin and nothing again..

I also tried to write a simple script, just like an hello world but always the same issue:

No errors popped up on screen or in cmd, but still nothing happens when i run an Ocra ruby executable with TK

This is the ocra output:

G:\WinRuby\efdsk>ocra efdsk.rb --windows --no-autoload --debug                                                          
=== Loading script to check dependencies                                                                                
=== Detected gem did_you_mean-1.2.0 (loaded, files)                                                                     
===     19 files, 38722 bytes                                                                                           
=== Detected gem ocra-1.3.10 (loaded, files)                                                                            
===     5 files, 210830 bytes                                                                                           
=== Detected gem tk-0.2.0 (loaded, files)                                                                               
===     419 files, 4623427 bytes                                                                                        
=== Including 59 encoding support files (3909616 bytes, use --no-enc to exclude)                                        
=== Building efdsk-debug.exe                                                                                            
=== Enabling debug mode in executable                                                                                   
=== Adding user-supplied source files                                                                                   
=== Adding ruby executable rubyw.exe                                                                                    
=== Adding detected DLL C:/Ruby25-x64/bin/ruby_builtin_dlls/libgmp-10.dll                                               
=== Adding detected DLL C:/Ruby25-x64/bin/ruby_builtin_dlls/libffi-6.dll                                                
=== Adding detected DLL C:/Ruby25-x64/msys64/mingw64/bin/tcl86.dll                                                      
=== Adding detected DLL C:/Ruby25-x64/msys64/mingw64/bin/tk86.dll                                                       
=== Adding detected DLL C:/Ruby25-x64/bin/ruby_builtin_dlls/zlib1.dll                                                   
=== Adding detected DLL C:/Ruby25-x64/msys64/mingw64/lib/reg1.3/tclreg13.dll                                            
=== Adding external manifest C:/Ruby25- 
x64/bin/ruby_builtin_dlls/ruby_builtin_dlls.manifest                             
=== Adding library files                                                                                                
=== Compressing 16872997 bytes                                                                                                                                                                                                                  
LZMA 4.65 : Igor Pavlov : Public domain : 2009-02-03                                                                    
=== Finished building efdsk-debug.exe (4029675 bytes) 

And this is the output when i try to start the exe file

G:\WinRuby\efdsk>start efdsk.exe

G:\WinRuby\efdsk> 

Also a simple script like this won't start:

require 'tk'
require 'tkextlib/tile'

root = TkRoot.new() 
button = Tk::Tile::TButton.new(root) {text "Hello World"}.grid

Tk.mainloop()

My ruby version:

ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32]

Solution

  • I solved by installing this ruby version:

    G:\WinRuby\efdsk>ruby -v                                                                                                
    ruby 2.3.3p222 (2016-11-21 revision 56859) [x64-mingw32]
    

    And this is the command i used for ocra:

    ocra efdsk.rb --windows C:\Ruby23-x64\lib\tcltk\ --no-autoload --add-all-core
    

    Now the exe file will run normally after double clicking it.