-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't like tk gem #29
Comments
I just wanted to let you know that this is still a problem (I was having trouble with which ocra version I was using, but now that I am definitely using 1.3.0, I am reporting this is still happening. All I need to reproduce is a file like this:
Cheers! |
I am having the same problem. I am using Ruby 1.9.3 on Windows XP. Program is just: require 'tk' error is: === Loading script to check dependencies Any help would be appreciated. Thanks. |
I had to give up, and ended up using fxruby, which actually I liked a lot better. If you would like more info on where I ended up for the UI on PC email me directly. Otherwise OCRA works great. |
Good advice, I just installed fxruby using gem and then OCRA built the exe without any problems. I will write my program using fxruby instead of tk. Thanks for your help. |
Same issue here, all that is required is a require 'tk' and get this: C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:271: warning: failed to set environment variable. Ruby 1.9.3 will raise SystemCallEr |
While I don't yet have a full understanding of the problem so I don't have a patch, I was able to package Tk with OCRA and distribute it to others as a self-contained exe without the user needing to install anything else. I encountered this issue with Ruby 1.9.2p290 (2011-07-09) [i386-mingw32] on Windows 7. I used the p290 RubyInstaller which packaged the Tk libraries with the Ruby installation. My app was only requiring the following gems: fileutils, tk, and tkextlib/tile. The problem is OCRA does some autoloading that Tk doesn't like. By adding the --no--autoload flag to the ocra build, it bypasses the attempt_load_autoload error everyone listed above. However, you'll then run into the following error:
So after some gratuitous use of the --debug-extract flag and experimentation, if you look at TL;DR
|
Upvote for workaround. This is not "fixable" in ocra (at best a workaround could be made automatic): Use this (same as mattsgarrison suggests):
|
I'm sure this is super late, but in finding my own problem with this, I found bogbasic's comment here which allowed me to use Tk and Ruby with Ocra: https://www.ruby-forum.com/topic/2981846 "Maybe too late but the thing to do is to copy the ruby file you wish to
... then you can copy the resulting .exe file to wherever you want |
Running on windows 7, under the ruby one click installer. ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
I have tried this with both ocra 1.2.0 and 1.3.0, and with both ruby 1.8.7 and 1.9.1/2
requiring the tk gem causes lots of failures. Just for fun I started putting rescues around the failure points in the tk code, but it just went on and on. (note removing the require 'tk' allows the exe to be created) Note also none of the tk code is being called. Its just requiring the gem that is causing the problems.
Here are some samples:
=== Loading script to check dependencies
C:/Ruby192/lib/ruby/1.9.1/tk/console.rb:13:in
_create_console': interpreter is deleted (RuntimeError) from C:/Ruby192/lib/ruby/1.9.1/tk/console.rb:13:in
create'from C:/Ruby192/lib/ruby/1.9.1/tk/console.rb:15:in `module:TkConsole'
def self.create
TkCore::INTERP._create_console # LINE 13 #
end
self.create # initialize console
putting a rescue at line 13 gets us to:
=== Loading script to check dependencies
C:/Ruby192/lib/ruby/1.9.1/tk/msgcat.rb:24:in
<class:TkMsgCatalog>': RuntimeErro r (RuntimeError) from C:/Ruby192/lib/ruby/1.9.1/tk/msgcat.rb:8:in
<top (required)>'from C:/Ruby192/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:467:in `con
st_get'
tk_call_without_enc('package', 'require', 'Tcl', '8.2') # Line 24 #
this problem is repeated a bunch of places in msgcat
and on it goes...
The text was updated successfully, but these errors were encountered: