0
I need to perform some custom tasks, but whenever I try, I get the following message: Application has been already initialized.
I searched several places, including the OS in English, but without success. It seems to have no definitive solution. My application is working normally with Puma and Nginx. My tasks file is 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 from require
, basically like this:
require "#{ENV["PWD"]}/config/environment.rb"
module Blockade
(...)
end
Can anyone tell me what I’m doing wrong?