I managed to eliminate the error by setting the env variable "PLACK_ENV" to anything which forces Mojolicious into PSGI mode, but Mojolicious seems to be hanging.
Also I tested with Dancer2 and it works:
#!/usr/bin/perl
use Dancer2;
use strict;
get '/' => sub {
"Hello World!"
};
dance;