Running a Sinatra app as a Windows service

Im mandated to deploy unfortunately on Windows . I was hoping to do it
on TorqueBox but on Windows Im encountering a number off issues , so I
think I will defer the TorqueBox deployment until I mature a bit its use
and especially its use on Windows.

Anyhow, my real immediate really urgent need is to deploy this as a
Windows service by Monday :slight_smile:

So its a sinatra app which takes in http , does MQ puts, some file event
listening etc. Pretty straightforward. At the moment I think I will try
to use Warbler to create a runnable jar which I trust it can do , I have
built jars with it, but then I need to figure out how to create a
windows service to wrap that war.

While developing I also used Trinidad.

I really cant take on app server learning curve now, I need a quick
solution to run the app and I will later figure out how to put in a more
scaleable context.

Any thoughts, ideas, feedback.

Greatly appreciated.

thanks

Charles

It should be pretty fast to setup the windows service with Trinidad’s
trinidad_init_services gem, just : jruby -S gem install
trinidad_init_services

and than run : jruby -S trinidad_init_service it will work you throught
the
details about your app (e.g. where it’s located on the FS) …

Hope you get it working by Monday :slight_smile:

K.

excellent, thank you

Im using Warbler to pack up into war , hopefully it can take that
output. Ill go check that out now.

Charles

that might not be the best choice - there’s no special support for
warbler
generated .war files …

thus theoretically, since that .war is self packed with jruby, it should
start “another” jruby from within the jruby trindiad’s running
… causing “virtual” true object-oriented recursion ending up opening a
black hole or bringing us world peace :slight_smile: !

so it might be best for you to roll old school … just put the rails
app
in the file-system as is.

Actually it was very useful and interesting. Namely it set me on trying
to ascertain whether I had a missing jar/wrong jar , it turns out that I
needed this:

bcprov-jdk15on-1.47.jar

which I found under
/Users/charles/.rvm/rubies/jruby-1.7.6/lib/ruby/shared

I tried Jbundler but i probably misunderstood how it works. We do need
something that pulls in all the dependent jars perhaps jbundler perhaps
your findjars.rb. Development cant that different from prod. I fear that
RVM might be making it too dependent. Need to indeed work with multiple
per project copies of Jruby. Thats exactly what we do with Smalltalk
that way you can replicate easily anywhere.

Now Im hoping I dont have any other system decencies, now to test on my
Windows vmware image.

thanks for the help

Charles

maybe Ill achieve world peace , lets hope.

policies that control me dont leave me that choice, supposedly you can
run the war under any Java app server, and I can service that.
or srvany the executable war

Charles

Warbler is not the way here unless you remove Trinidad.

Srvany is the right way, but keep in mind the service will not restart
if
your app crashes. At least if you get reboots due to Windows updates,
your
service will restart…

This thread may be useful

https://www.ruby-forum.com/topic/4416022

…R