Error rebuilding on 2GB RAM without swap

You need 2gb swap. If you ran discourse-setup it would have created it