0

How can I create an admin for my app which is running on heroku with spree.

Here's what I am trying but doesn't seem to be working.

new_admin=Spree::User.create(:email=>"test@gmail.com",
:password =>"testtest", :password_confirmation =>"testtest")

I am going into heroku rails console, and trying it.

Please help.

Suraj
  • 41
  • 8

1 Answers1

2

You can try using heroku run command.

Spree has it's own rake command to create an admin user.

from terminal run below command

heroku run rake spree_auth:admin:create

Kushal
  • 342
  • 1
  • 7
  • This answer worked for me (Spree 4.0) `heroku run bundle exec rake spree_auth:admin:create` – MaxRah Dec 14 '19 at 18:16