Read RACK_ENV but apply RAILS_ENV

Ruby whenever uses RAILS_ENV in crontab.
This commit is contained in:
ricola 2025-10-07 10:24:23 +02:00
parent fa1a58bea2
commit 0dd3d03b67
2 changed files with 8 additions and 2 deletions

View file

@ -1,4 +1,10 @@
require 'sinatra'
# Set environment before requiring 'sinatra/activerecord' to make `whenever` uses the database.
if ENV['RAILS_ENV']
set :environment, ENV['RAILS_ENV']
end
require 'sinatra/activerecord'
require 'bcrypt'
require 'gettext'