Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return

When you add a plugin you will want to copy abd position the code like the one above. I believe no spaces between lines.

Also verify the plugin you want to use is still supported.