bundle exec script/discourse is the solution here. The second problem is because you were running bundle exec script/discourse while you were in /var/www/discourse/script instead of /var/www/discourse.
bundle exec script/discourse is the solution here. The second problem is because you were running bundle exec script/discourse while you were in /var/www/discourse/script instead of /var/www/discourse.