Bin-file on linux

How to convert the script code to bin-file(Linux)?

···

--
Posted via http://www.ruby-forum.com/.

http://www.lmgtfy.com/?q=ruby+compile+binary

···

On Mon, Aug 8, 2011 at 4:32 AM, CC Chen <dickyhide@gmail.com> wrote:

How to convert the script code to bin-file(Linux)?

--
Phillip Gawlowski

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

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 White
http://www.twitter.com/cwgem

···

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/\.

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.

···

--
Posted via http://www.ruby-forum.com/.

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.

···

On Mon, Aug 08, 2011 at 11:43:33AM +0900, Chris White wrote:

On Aug 7, 2011, at 7:32 PM, CC Chen wrote:
>
> How to convert the script code to bin-file(Linux)?

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.

--
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]

Chris White 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 White
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,

--
Posted via http://www.ruby-forum.com/\.

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,

···

--
Posted via http://www.ruby-forum.com/\.

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

···

On Mon, Aug 8, 2011 at 10:48 PM, CC Chen <dickyhide@gmail.com> wrote:

Chris White 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 White
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,

--
Posted via http://www.ruby-forum.com/\.

This stuff is hard. Shoes does it, and it's sometimes buggy. Doing it right
means embedding the interpreter and such...

···

On Aug 23, 2011 12:58 AM, "CC Chen" <dickyhide@gmail.com> wrote:

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,

--
Posted via http://www.ruby-forum.com/\.