<div dir="ltr">Hello,<div><br></div><div>I have built a QtRuby application, and I've been trying to "release" it for a few days. My requirements target Windows + Mac OS X primarily, and Linux too preferably. My users can not be required to download or install any extra dependencies for the application, so it _MUST_ be self-contained, ie, a binary, a bundle, a package, you name it.</div>
<div><br></div><div>I have searched and read everything I could come across that relates to this process, and here's what I've tried:</div><div><br></div><div><ol><li>Crate @ <a href="http://github.com/copiousfreetime/crate">http://github.com/copiousfreetime/crate</a><br>
I tried to adapt the 1 example I found throughout the whole internet to my needs, but I failed. The author's example is very basic, it covers bundling a simple SSL/authentication script, and by simple I mean it requires few to none dependencies (ruby gems, or static libraries as Qt is in my case).<br>
<br></li><li>Ocra @ <a href="http://ocra.rubyforge.org/">http://ocra.rubyforge.org/</a><br>Ocra targets Windows only, it does not meet my requirements, thus I skipped it.<br><br></li><li>tar2rubyscript & rubyscript2exe by Erik Veen @ <a href="http://www.erikveen.dds.nl/tar2rubyscript/">http://www.erikveen.dds.nl/tar2rubyscript/</a><br>
Ok this one looked like a candidate, and I spent most of my time trying to make it work, it almost did, but not really; I will include a more descriptive explanation of the problems I came across using rubyscript2exe below. </li>
</ol></div><div>In the first "step" of the RBA process, and that is tar2rubyscript, I succeed. My application is bundled into an albeit huge 37mbytes .rb file, and I can `ruby my_application.rb` and it runs OK. The problems lie in the 2nd stage, and that is converting that tar into an executable; here is my console output:</div>
<div><br></div><div>kandie:~/Workspace/Experiments/Ruby/deployment$ rubyscript2exe.rb Kaboomp3.rb </div><div>Tracing Kaboomp3 ...</div><div>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</div><div>+                              kaBooMP3                             +</div>
<div>+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+</div><div>+ initializing Organizer</div><div>+ Organizer: ready to blow up!</div><div>+ initializing Qt</div><div>+ loading resource key: master from file: resources.rcc</div>
<div>+ mounting models</div><div>+ loading controllers</div><div>Gathering files...</div><div>/tmp/tar2rubyscript.d.46763.1/rubyscript2exe/require2lib.rb:60:in `gatherlibs': undefined method `list' for Gem::Specification:Class (NoMethodError)</div>
<div>        from /tmp/tar2rubyscript.d.46763.1/rubyscript2exe/require2lib.rb:30</div><div>/tmp/tar2rubyscript.d.46763.1/rubyscript2exe/require2lib.rb:151:in `require2lib_load': can't convert Qt::File into String (TypeError)</div>
<div>        from /tmp/tar2rubyscript.d.46763.1/rubyscript2exe/require2lib.rb:151:in `load_without_new_constant_marking'</div><div>        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in `load'</div>
<div>        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'</div><div>        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in `load'</div>
<div>        from /tmp/tar2rubyscript.d.46764.1/Kaboomp3/lib/kaboomp3/utility.rb:57:in `load_view'</div><div>        from /tmp/tar2rubyscript.d.46764.1/Kaboomp3/kaboomp3.rb:102:in `setup'</div><div>        from /tmp/tar2rubyscript.d.46764.1/Kaboomp3/kaboomp3.rb:127:in `initialize'</div>
<div>        from /tmp/tar2rubyscript.d.46764.1/Kaboomp3/kaboomp3.rb:34:in `new'</div><div>        from /tmp/tar2rubyscript.d.46764.1/Kaboomp3/kaboomp3.rb:34:in `instance'</div><div>        from /tmp/tar2rubyscript.d.46764.1/Kaboomp3/kaboomp3.rb:139</div>
<div>        from /private/tmp/tar2rubyscript.d.46764.1/Kaboomp3/init.rb:2:in `require'</div><div>        from /private/tmp/tar2rubyscript.d.46764.1/Kaboomp3/init.rb:2</div><div>        from /tmp/tar2rubyscript.d.46763.1/rubyscript2exe/require2lib.rb:151:in `require2lib_load'</div>
<div>        from /tmp/tar2rubyscript.d.46763.1/rubyscript2exe/require2lib.rb:151:in `load'</div><div>        from Kaboomp3.rb:610</div><div>        from Kaboomp3.rb:559:in `newlocation'</div><div>        from Kaboomp3.rb:487:in `newlocation'</div>
<div>        from Kaboomp3.rb:454:in `newlocation'</div><div>        from Kaboomp3.rb:487:in `newlocation'</div><div>        from Kaboomp3.rb:559:in `newlocation'</div><div>        from Kaboomp3.rb:603</div><div>
Couldn't execute this command (rc=256):</div><div>/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -r 'enumerator.so' -I '/tmp/tar2rubyscript.d.46763.1/rubyscript2exe' -I '/tmp/tar2rubyscript.d.46763.1' -I '/Library/Ruby/Site/1.8' -I '/Library/Ruby/Site/1.8/powerpc-darwin10.0' -I '/Library/Ruby/Site/1.8/universal-darwin10.0' -I '/Library/Ruby/Site' -I '/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby/1.8' -I '/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby/1.8/universal-darwin10.0' -I '/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby' -I '/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8' -I '/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/powerpc-darwin10.0' -I '/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0' -I '.' -I '/Volumes/kandie/Workspace/Experiments/Ruby/deploy' -I '/private/tmp/tar2rubyscript.d.46763.1/rubyscript2exe' -I '/private/tmp/tar2rubyscript.d.46763.1/rubyscript2exe/lib' -I '/private/tmp/tar2rubyscript.d.46763.1/rubyscript2exe' -I '/private/tmp/tar2rubyscript.d.46763.1/rubyscript2exe/lib' -r '/tmp/tar2rubyscript.d.46763.1/rubyscript2exe/require2lib.rb' 'Kaboomp3.rb'   </div>
<div>Stopped.</div><div><br></div><div>I need to emphasize this line `<meta charset="utf-8">can't convert Qt::File into String (TypeError)` which is generated in my helper method `load_view` which code is:</div><div><br>
</div><div><div>    def load_view(path, parent, loader)</div><div>      sheet = Qt::File.new(path)</div><div>      sheet.open(Qt::File::ReadOnly)</div><div>      view = loader.load(sheet, parent)</div><div>      sheet.close</div>
<div>      </div><div>      view</div><div>    end</div><div><br></div><div>loader is a Qt::UiLoader instance.</div><div><br></div><div>Ok, so things break on that line, `view = loader.load(sheet, parent)` and I just can't tell why rubyscript2exe is trying to convert `sheet` which is a Qt::File into a string. I can't see the correspondence. The things that I've tried doing:</div>
<div><br></div><div><ul><li>I thought there might be some name clash / conflict in my code.. so i renamed my load_view() method to something more specific, no use</li><li>I wondered if at some point rubyscript2exe was trying to do myQtFile.to_s to do whatever processing it might be doing, so I added a to_s method to Qt::File class, which returns the attribute fileName (the actual file path) that didn't work either</li>
<li>I removed that line altogether; I stopped loading views, et voila, it worked, but hey I've got no UI views now >.></li></ul><div>To add to my curiosity, what's up with that line that has to do with active_record up there? AR is a dependency in my project, indeed, I'm using it with Sqlite3, but it's not even remotely connected to the part where i load my views...</div>
</div><div><br></div><div>I'm so confused and in dire need of help, as this is a school project which deadline is due next week, and should I fail to meet it, I will fail the course.</div><div><br></div><div>How can I package my application?</div>
<div><br></div><div>I thank you for reading through this and for your time.</div>-- <br>There are 10 types of people, those who understand binary, and those who don't.<br>
</div></div>