2

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]
lucaortis
  • 430
  • 2
  • 11
  • This boils down to "not working" which is not a sufficiently technical diagnostic. Does it produce any output? Does the Ruby source version still work? Can you rebuild it with Ocra? – tadman May 04 '18 at 17:55
  • The script runs fine if i run it from the .rb file. And it works fine also while im building it with ocra. The problems is that the exe file wont start when i double click it, not as a normal user and not as admin. Again, no errors revealed from ocra or windows, it will just not start when i double click it. I tried it on Windows 10 and Windows 7. – lucaortis May 04 '18 at 18:04
  • 1
    Unless you can show us a minimal non-working example that we can experiment with and reproduce the problem, you're on your own here and will have to do more diagnostic work. It's really hard to say why your code doesn't run on your computer when we have no access to either. – tadman May 04 '18 at 18:05
  • I tried it on 3 conputers, and also a simple hello world program with TK won't run.. I can make a video and link it here in some way, or link my script – lucaortis May 04 '18 at 18:09
  • @tadman i added some info, but to me it looks like everything is working fine.. But then it won't run.. Should i try another ruby version? – lucaortis May 04 '18 at 18:30
  • Video is less useful than code that we can run. A video is just evidence of something we can't experiment with. What's the smallest program you can make that reproduces this issue? – tadman May 04 '18 at 18:30
  • do you start the exe on the same computer, were you started your rb script? (Just to be sure, it is not a missing dll on another computer) – knut May 04 '18 at 18:33
  • Yes same computer, and i tried to run the exe on other 2 computers. Both with windows 7, and it didn't start on those too – lucaortis May 04 '18 at 18:35

1 Answers1

1

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.

lucaortis
  • 430
  • 2
  • 11