Why am I getting an error on the first request after restarting the Sinatra app using Rack and Phusion Passenger?

After I touched tmp / restart.txt and my application rebooted, the first request throws an error, usually something that you did not find Haml :: Engine or any other stone. The second and subsequent queries work fine. I had this problem on Dreamhost in which Rack 0.4.1 and Sinatra 0.3.3 worked, but after switching to my own host and starting a new rack (0.9.1) and Sinatra (0.9.0.4), I still see the problem.

If you do not know the exact answer, but have tips on how I could track it, let me know.

Here is my config.ru:

require 'rubygems'
require 'sinatra'

disable :run
set :environment, :production
set :raise_errors, true

require 'app.rb'
run Sinatra::Application
+1
2

, . , - , , . rubygems?

, (config.ru).

+2

Sinatra . :

#config.ru

ENV['GEM_HOME'] ||= `gem env path`.strip.split(':').first
ENV['GEM_PATH'] ||= `gem env path`.strip
Gem.clear_paths

require 'application-filename-goes-here'
set :environment, :production
run Sinatra::Application
+1

Source: https://habr.com/ru/post/1724449/


All Articles