From 921bfd73ccb6e105be639da7da36b69c41247838 Mon Sep 17 00:00:00 2001 From: ricola Date: Tue, 7 Oct 2025 10:24:23 +0200 Subject: [PATCH] Read RACK_ENV but apply RAILS_ENV Ruby whenever uses RAILS_ENV in crontab. --- config/schedule.rb | 4 ++-- vedia.rb | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/schedule.rb b/config/schedule.rb index 37830fe..ec9ae59 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -1,5 +1,5 @@ -if ENV['RAILS_ENV'] - set :environment, ENV['RAILS_ENV'] +if ENV['RACK_ENV'] + set :environment, ENV['RACK_ENV'] end set :output, 'vedia.log' diff --git a/vedia.rb b/vedia.rb index 048ed62..721c967 100644 --- a/vedia.rb +++ b/vedia.rb @@ -10,6 +10,10 @@ require 'redcarpet' include GetText +if ENV['RAILS_ENV'] + set :environment, ENV['RAILS_ENV'] +end + require_relative 'mj' require_relative 'config/environments/defaults.rb' require_relative "config/environments/#{settings.environment}"