Error 500 after command line rebuild

Try a git pull before rebuild

cd /var/discourse
git pull
./launcher rebuild app