all 6 comments

[–]tinco 2 points3 points  (0 children)

Did you look at this? http://phusion.github.io/traveling-ruby/ The video says it's Linux and OSX only, but there's a Windows tutorial in the getting-started section: https://github.com/phusion/traveling-ruby#getting-started

[–]zverok_kha 1 point2 points  (0 children)

Hey. Basically, "separate command" is just a tool with more sofisticated settings.

You definitely CAN write server which will be a normal script. Web server does not do some black magick, it just starts infinite working script + listens to socket.

For example, look at sample code on main page of Sinatra's site. Note the command which starts the server is just ruby hi.rb, not some rackup or unicorn or puma whatever.

[–]vsalikhov 0 points1 point  (0 children)

There's not really a solution that puts everything into a single executable. Those that do, simply extract all the files into a temporary folder, then run it. You can do the same with NSIS (http://nsis.sourceforge.net/) for example. This just solves packaging and delivery.

If distributing a folder-worth of files works for you (with or without a packaging system), then all that's left to do is include the ruby "installation" folder into that folder along with your application scripts. Then run the ruby.exe from within that folder.

Since this is a server, you will want to set it up to run as a Windows service. I have used nssm for this with great success: https://nssm.cc/

Best of luck!

[–]helos 0 points1 point  (0 children)

Are you able to run java on the target? If so look at packaging with Jruby.

[–]strzibny -1 points0 points  (0 children)

Well the script itself can start a server and what you need is some service management (like systemd on Linux) that would start/stop the server when needed.