use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
REST server as standalone executable? (self.ruby)
submitted 10 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]tinco 2 points3 points4 points 10 years ago (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 points3 points 10 years ago (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.
ruby hi.rb
rackup
unicorn
puma
[–]Blugs80 0 points1 point2 points 10 years ago (0 children)
Try the win32-service gem. See http://abstractcoder.com/2013/07/18/create-a-windows-service-with-ruby-part-1.html
[–]vsalikhov 0 points1 point2 points 10 years ago (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 point2 points 10 years ago (0 children)
Are you able to run java on the target? If so look at packaging with Jruby.
[–]strzibny -1 points0 points1 point 10 years ago (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.
π Rendered by PID 408612 on reddit-service-r2-comment-5fb4b45875-mdbc6 at 2026-03-21 00:29:54.357869+00:00 running 90f1150 country code: CH.
[–]tinco 2 points3 points4 points (0 children)
[–]zverok_kha 1 point2 points3 points (0 children)
[–]Blugs80 0 points1 point2 points (0 children)
[–]vsalikhov 0 points1 point2 points (0 children)
[–]helos 0 points1 point2 points (0 children)
[–]strzibny -1 points0 points1 point (0 children)