I have a ruby script which takes some fare amount of time to finish running. I have tried running this code:
get "/run" do
exec "ruby #{"/home/user/script.rb"} &"
redirect '/'
end
But what happens is that, my Sinatra script then waits until the process is finished. How to execute that script so it is left to run in the background, and my Sinatra script just redirects back?
Thanks!