title: Controller waiting for response and then the application fails Ruby on rails
body: <p>My Controller waits for a response from a lib folder ruby  file which it is calling.</p>
  
  <p>lib.rb runs for about 4 minutes and returns a string as result.</p>
  
  <p>The controller waits for the string response and then application breaks after a minute  showing Internal Server Error</p>
  
  <p>what should i Do?</p>
  
  <p>Regards</p>