Hello, I have put together a little prog that uses Tk for a simple GUI and it runs fine as a .rb file. However if I convert it to an exe file with ocra....
ocra --no-dep-run --add-all-core fred.rb
.... I get an exe file with no errors but if I run it, I get an error in 'initialise': Can't find a usable init.tcl in the following directories....This probably means tcl wasn't installed properly.
If you are using a gem (or multiple gems) for tk, you'll have to give ocra that information as well, either manually or by setting up a bundler gemfile for your app. I'm guessing that's the source of your problem.
On Mon, Dec 12, 2011 at 5:08 PM, bogbasic <j...@jbc.me.uk> wrote: > Hello, I have put together a little prog that uses Tk for a simple GUI and > it runs fine as a .rb file. However if I convert it to an exe file with > ocra....
> ocra --no-dep-run --add-all-core fred.rb
> .... I get an exe file with no errors but if I run it, I get an error in > 'initialise': Can't find a usable init.tcl in the following > directories....This probably means tcl wasn't installed properly.
> Hello, I have put together a little prog that uses Tk for a simple GUI and > it runs fine as a .rb file. However if I convert it to an exe file with > ocra....
> ocra --no-dep-run --add-all-core fred.rb
> .... I get an exe file with no errors but if I run it, I get an error in > 'initialise': Can't find a usable init.tcl in the following > directories....This probably means tcl wasn't installed properly.
Many thanks indeed for the very quick replies. There is just one .rb file that I am trying to compile and I am not using any gems for Tk as far as I know - just a single script that calls bits of Tk. I'm really thick at all this. I tried the following....
ocra fred.rb --windows c:\Ruby193\lib\tcltk\ --add-all-core --no-dep- run --no-autoload
... and it produced a .exe file. However, on running the .exe, the program runs for a bit without producing a GUI window and then it just dies with no errors.
Any clues much appreciated.
On Dec 12, 10:11 pm, Gustav Andersson <gustavlidi...@gmail.com> wrote:
> > Hello, I have put together a little prog that uses Tk for a simple GUI and > > it runs fine as a .rb file. However if I convert it to an exe file with > > ocra....
> > ocra --no-dep-run --add-all-core fred.rb
> > .... I get an exe file with no errors but if I run it, I get an error in > > 'initialise': Can't find a usable init.tcl in the following > > directories....This probably means tcl wasn't installed properly.
Hello, tried a few more things along the lines suggested and I am still getting the message that it can't find the init.tcl. If I run it without --no-dep-run it picks up the DLLs for Tk but still I get that message. Any clues at all much appreciated as I am a relative newbie to ruby and even newer to Tk so I may be missing something obvious. The code's here...
> Many thanks indeed for the very quick replies. There is just one .rb > file that I am trying to compile and I am not using any gems for Tk as > far as I know - just a single script that calls bits of Tk. I'm really > thick at all this. I tried the following....
> ocra fred.rb --windows c:\Ruby193\lib\tcltk\ --add-all-core --no-dep- > run --no-autoload
> ... and it produced a .exe file. However, on running the .exe, the > program runs for a bit without producing a GUI window and then it just > dies with no errors.
> Any clues much appreciated.
> On Dec 12, 10:11 pm, Gustav Andersson <gustavlidi...@gmail.com> wrote:
> > > Hello, I have put together a little prog that uses Tk for a simple GUI and > > > it runs fine as a .rb file. However if I convert it to an exe file with > > > ocra....
> > > ocra --no-dep-run --add-all-core fred.rb
> > > .... I get an exe file with no errors but if I run it, I get an error in > > > 'initialise': Can't find a usable init.tcl in the following > > > directories....This probably means tcl wasn't installed properly.
I'm afraid you're going to have to spend some time digging around yourself in order to (a) figure out which files Tk wants that aren't being included, and (b) where they need to be in order for Tk to find them. Then, have Ocra manually include those files, and extract them to usable places (and/or set their locations in whatever environment variables are needed) before initializing Tk.
On Tue, Dec 13, 2011 at 11:27 AM, bogbasic <j...@jbc.me.uk> wrote: > Hello, tried a few more things along the lines suggested and I am > still getting the message that it can't find the init.tcl. If I run it > without --no-dep-run it picks up the DLLs for Tk but still I get that > message. Any clues at all much appreciated as I am a relative newbie > to ruby and even newer to Tk so I may be missing something obvious. > The code's here...
> On Dec 12, 11:19 pm, bogbasic <j...@jbc.me.uk> wrote: > > Many thanks indeed for the very quick replies. There is just one .rb > > file that I am trying to compile and I am not using any gems for Tk as > > far as I know - just a single script that calls bits of Tk. I'm really > > thick at all this. I tried the following....
> > ... and it produced a .exe file. However, on running the .exe, the > > program runs for a bit without producing a GUI window and then it just > > dies with no errors.
> > Any clues much appreciated.
> > On Dec 12, 10:11 pm, Gustav Andersson <gustavlidi...@gmail.com> wrote:
> > > > Hello, I have put together a little prog that uses Tk for a simple > GUI and > > > > it runs fine as a .rb file. However if I convert it to an exe file > with > > > > ocra....
> > > > ocra --no-dep-run --add-all-core fred.rb
> > > > .... I get an exe file with no errors but if I run it, I get an > error in > > > > 'initialise': Can't find a usable init.tcl in the following > > > > directories....This probably means tcl wasn't installed properly.
Thanks, its sorted c/o the github discussion above which gave a critical clue....
The thing to do is to copy the ruby file you wish to compile to the C: \Ruby193\lib folder which contains the tcltk directory and then run ocra there as follows....
ocra fred.rb tcltk --no-autoload
... then you can copy the resulting .exe file to wherever you want afterwards and it runs fine.
On Dec 13, 5:17 pm, David Simon <david.mike.si...@gmail.com> wrote:
> I'm afraid you're going to have to spend some time digging around yourself > in order to (a) figure out which files Tk wants that aren't being included, > and (b) where they need to be in order for Tk to find them. Then, have Ocra > manually include those files, and extract them to usable places (and/or set > their locations in whatever environment variables are needed) before > initializing Tk.
> On Tue, Dec 13, 2011 at 11:27 AM, bogbasic <j...@jbc.me.uk> wrote: > > Hello, tried a few more things along the lines suggested and I am > > still getting the message that it can't find the init.tcl. If I run it > > without --no-dep-run it picks up the DLLs for Tk but still I get that > > message. Any clues at all much appreciated as I am a relative newbie > > to ruby and even newer to Tk so I may be missing something obvious. > > The code's here...
> > On Dec 12, 11:19 pm, bogbasic <j...@jbc.me.uk> wrote: > > > Many thanks indeed for the very quick replies. There is just one .rb > > > file that I am trying to compile and I am not using any gems for Tk as > > > far as I know - just a single script that calls bits of Tk. I'm really > > > thick at all this. I tried the following....
> > > ... and it produced a .exe file. However, on running the .exe, the > > > program runs for a bit without producing a GUI window and then it just > > > dies with no errors.
> > > Any clues much appreciated.
> > > On Dec 12, 10:11 pm, Gustav Andersson <gustavlidi...@gmail.com> wrote:
> > > > > Hello, I have put together a little prog that uses Tk for a simple > > GUI and > > > > > it runs fine as a .rb file. However if I convert it to an exe file > > with > > > > > ocra....
> > > > > .... I get an exe file with no errors but if I run it, I get an > > error in > > > > > 'initialise': Can't find a usable init.tcl in the following > > > > > directories....This probably means tcl wasn't installed properly.