I need to perform some custom tasks, however, whenever I try, I get the following message: Application has been already initialized.
I searched in various places, including the OS in English, but to no avail. It does not seem to have a definitive solution. My application is running normally, with Puma and Nginx. My tasks file looks like this:
namespace :access do
require "modules/blockade.rb"
desc "Block everybody"
task block: :environment do
(...)
end
desc "Unblock everybody"
task unblock: :environment do
(...)
end
end
And this file of require
, basically like this:
require "#{ENV["PWD"]}/config/environment.rb"
module Blockade
(...)
end
Can anyone tell me what I'm doing wrong?