Sinatra on Passenger always fails on first try

I have a small Sinatra app. I am running a shared account using Passenger. However, the first time the application opens after some time, I get a Passenger error page in which the application cannot be launched. Usually because Sinatra was not found.

I assume that this is just a normal delay from the moment a new instance arrives. However, is there a way to delay trying to download Siantra until it is fully loaded?

+2
source share
4 answers

I seem to have solved the problem by setting the environment variable GEMS_PATHto a .htaccess file. I have not encountered this error yet. TILL!

0
source

Recently, I used Dreamhost support (not a lot of experience), and in the end they recommended freezing gems in the application. This is, at best, a partial solution because it works for some gems, not others.

Instead

require 'sinatra'

I have:

require 'vendor/gems/sinatra-0.9.4/lib/sinatra'

Freezing gemstones are considered elsewhere, but briefly: to prepare for this you need to do

mkdir vendor/gems
cd vendor/gems
gem unpack sinatra

, , . , , . , , "" "vendor".

0

, Gem.clear_paths!

0

I had a similar problem a long time ago. An update for the new Sinatra stone helped me - in which version are you working?

0
source

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


All Articles