Admin-Konto von der Konsole aus aktivieren

I am trying to setup Discourse with one-click installer using droplet over Digital Ocean. I followed all the instructions and have correctly configured the SMTP details. But when I register for the admin account using the front-end installer, I am not able to receive the email.

I read a tutorial where it is mentioned that if the email doesn’t land in the mailbox, I can still activate the account and set the user as admin using the following commands using the console:

cd /var/discourse
sudo ./launcher enter app
rails c
user = User.find_by_email("<admin_email>")
user.admin = true
user.approved = true
user.save
EmailToken.confirm(user.email_tokens.first.token)

I am able to run the commands up to the fourth line. After running the fourth command, it finds and displays the user details. But I am not able to enter the next command. There’s this colon “:” and when I reach the end of the displayed details, “(END)” is written. I can’t type and run the further commands to activate the user.

After rails c, there’s this [1] pry (main) > thing. I am not so much acquainted with the command line. Please help me out.

1 „Gefällt mir“

When the colon appears, press q to get back to a prompt, and type the next command.

3 „Gefällt mir“

Thanks. It resolved the issue.

If you’re not receiving mail, then mail is not correctly configured.

You seem to have solved your account creation problem, but the recommended way to create an admin account and password is

. /launcher enter app
rails c
rake admin:create

That will allow you to

  • create an account
  • change an account password
  • assign admin to an account
5 „Gefällt mir“

This worked great! Note that the rails c is not necessary for running the rake commands.

3 „Gefällt mir“

Ich kann das Administratorkonto gemäß Ihrem Beitrag in der neuesten Version nicht aktivieren. Der Fehler ist beim letzten Befehl aufgetreten:

Derzeit erstellen Sie einen Administrator über die Konsole wie folgt:

./launcher enter app
rake admin:create
1 „Gefällt mir“

Ich habe hier gerade eine Lösung gefunden: Discourse Admin Quick Start Guide

Dieses Thema wurde nach 2324 Tagen automatisch geschlossen. Neue Antworten sind nicht mehr möglich.