regtest method not found
Do you have wallet enabled? generate is a wallet RPC now since it needs to get an address from the wallet. If wallets are disabled, then generate will not work. If you want to mine without wallets being enabled, use generatetoaddress.