What is the best method of running Sinatra in prod on Windows 2012?

37 views
Skip to first unread message

Charlie Baum

unread,
Jul 1, 2015, 10:30:56 AM7/1/15
to sina...@googlegroups.com
I have a Sinatra app that makes calls to powershell scripts so I require Windows.  So what is the best way/app to run Sinatra in prod on Windows?  Something that can be at least somewhat managed remotely, or at least restarted with powershell remoting.  Any help would be appreciated.

Kenneth Leung

unread,
May 24, 2016, 3:38:36 AM5/24/16
to sina...@googlegroups.com
I did something similar...

The main idea is to use ruby's Kernel#system

get '/powerscript/list_dir' do  
redirect url("/run/ls/-Name")
end

get '/run/?:command?/?:args?' do
  @command, @arguments = params[:captures]
  powershell = 'C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe'
  cmd = "#{powershell} #{@command} #{@arguments}"

status = settings.production? ? system(cmd) : puts(cmd)

haml :job_added
end

I hope this would give you some ideas.

Good luck

On Wed, Jul 1, 2015 at 7:29 AM, Charlie Baum <charl...@gmail.com> wrote:
I have a Sinatra app that makes calls to powershell scripts so I require Windows.  So what is the best way/app to run Sinatra in prod on Windows?  Something that can be at least somewhat managed remotely, or at least restarted with powershell remoting.  Any help would be appreciated.

--
You received this message because you are subscribed to the Google Groups "sinatrarb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sinatrarb+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages