5

Ocra is unable to handle applications that require 'tk'

require 'tk'
puts 'nope'

Packing this code with ocra http://github.com/larsch/ocra doesn't work (like mentioned in one of the issues at the link) Issue: https://github.com/larsch/ocra/issues/29

(Ocra is the 'new' rubyscript2exe for 1.9, essentially it's for deploying a rb script as an executable)

The only problem seems to be the missing DLL files for tcl

I don't think it's an issue

AFAIK the problem are the missing DLL files for tk
If they are known they can be included when executing ocra

Is there a way to know the DLL dependecies required for tk to work?

  • I didn't look on the issue tracker today... it is solved already (some hours ago), sorry. ocra.bat .\lib\main.rb --windows C:\Ruby192\lib\tcltk\ --no-autoload --add-all-core (add all core is optional, don't include it if the exe works without it) --> http://github.com/larsch/ocra/issues/29 – Onetimeposter123 Sep 22 '11 at 08:13
  • If you tried it and it worked, you should post this as an aswer and accept it (see http://meta.stackexchange.com/questions/12513/should-i-not-answer-my-own-questions). – undur_gongor Sep 23 '11 at 08:19

1 Answers1

10

I didn't look on the issue tracker today... it is solved already (some hours ago), sorry.

ocra rubyfile.rb --windows C:\Ruby192\lib\tcltk\ --no-autoload --add-all-core

(--add-all-core is optional, don't include it if the exe works without it)

--> https://github.com/larsch/ocra/issues/29

  • Note: ordering is important! Follow the parent's example. – Pakman Jan 19 '12 at 19:47
  • None of this works for me. When I use `ocra file.rb --windows...` I get a require cannot load such file. When I use `bundle exec ocra file.rb --windows ....`, the program will appear, but then give an error about it doesn't know what to do with the .gitignore. `ERROR: Don't know where to put gemfile C:/Users/user1/Desktop/ruby-tk/tk_02/.gitignore` – FilBot3 Jan 30 '15 at 02:31