How to convert the script code to bin-file(Linux)?
On Mon, Aug 8, 2011 at 4:32 AM, CC Chen [email protected] wrote:
How to convert the script code to bin-file(Linux)?
–
Phillip G.
phgaw.posterous.com | twitter.com/phgaw | gplus.to/phgaw
A method of solution is perfect if we can forsee from the start,
and even prove, that following that method we shall attain our aim.
– Leibniz
On Aug 7, 2011, at 7:32 PM, CC Chen wrote:
How to convert the script code to bin-file(Linux)?
–
Posted via http://www.ruby-forum.com/.
It depends on what you wish to accomplish by that. If you just want a
file that can be run like a binary executable you can always set the
script as executable (chmod 775 file.rb) and put a shebang at the top:
#!/usr/bin/env ruby
Assuming you want something that can be installed and setup for the user
to be run, you can still make the script executable then package it up
as a gem. See the redcar gem for an example of such a setup. Another
remote possibility is using JRuby to compile to java class files, throw
those in a jar, then use something like launch4j as a wrapper. However
that seems a bit much to achieve your goal.
Regards,
Chris W.
http://www.twitter.com/cwgem
Chris W. wrote in post #1015421:
On Aug 7, 2011, at 7:32 PM, CC Chen wrote:
How to convert the script code to bin-file(Linux)?
–
Posted via http://www.ruby-forum.com/.It depends on what you wish to accomplish by that. If you just want a
file that can be run like a binary executable you can always set the
script as executable (chmod 775 file.rb) and put a shebang at the top:#!/usr/bin/env ruby
Assuming you want something that can be installed and setup for the user
to be run, you can still make the script executable then package it up
as a gem. See the redcar gem for an example of such a setup. Another
remote possibility is using JRuby to compile to java class files, throw
those in a jar, then use something like launch4j as a wrapper. However
that seems a bit much to achieve your goal.Regards,
Chris W.
http://www.twitter.com/cwgem
Could I run the JRuby to java class on windows model and put the class
file to linux model, does it also can run on linux?
Thanks,
CC -
Ruby should be portable across OS’s.
Can you give us more information about what your goal is, what you’ve
tried, etc.?
I think the answer may be not be so difficult.
You know you can run a Ruby script by calling the ruby interpreter,
right?:
ruby myscript.rb
If you want it to look like a standalone program in Windows, you could
always write a batch file that included the above.
- Keith
Have you tried rubyscript2exe?
http://www.erikveen.dds.nl/rubyscript2exe/
It claims to work on Linux (although I have never tried it there).
Also, try googling “ruby package executable linux”. It seems to give at
least some maybe useful resources.
For Windows, there’s the super-easy Ocra gem - as last resort, you may
try this and running thru Wine.
On Mon, Aug 08, 2011 at 11:43:33AM +0900, Chris W. wrote:
Assuming you want something that can be installed and setup for the
user to be run, you can still make the script executable then package
it up as a gem. See the redcar gem for an example of such a setup.
Another remote possibility is using JRuby to compile to java class
files, throw those in a jar, then use something like launch4j as a
wrapper. However that seems a bit much to achieve your goal.
I have a sneaking suspicion CC Chen would like something that does not
require installing Ruby separately, but I could be making an unwarranted
assumption here.
This stuff is hard. Shoes does it, and it’s sometimes buggy. Doing it
right
means embedding the interpreter and such…
Bartosz Dziewoński wrote in post #1016186:
Have you tried rubyscript2exe?
http://www.erikveen.dds.nl/rubyscript2exe/
It claims to work on Linux (although I have never tried it there).Also, try googling “ruby package executable linux”. It seems to give at
least some maybe useful resources.For Windows, there’s the super-easy Ocra gem - as last resort, you may
try this and running thru Wine.
On Windows I have tried ocra.
It’s really easy to use.
But rubyscript2exe seems can’t work on windows and linux.
Thanks,