Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating an admin user in production on Spree

I deployed my Spree app to a server. Locally I can login as an admin and change things, but on the server this password and account does not work. When I go to /admin I get the message authorization failure.

I did already run bundle exec rake spree_auth:admin:create and bundle exec rake db:migrate but this does not work. Furthermore, I can also login with my e-mailaddress and password I got from the hosting company, but I can not go to the admin page.

Does anyone know how I create an admin user?

like image 249
Erwin Rooijakkers Avatar asked Oct 06 '13 21:10

Erwin Rooijakkers


1 Answers

Deploying Spree doesn't (and shouldn't) copy your database from development to production.

So your development admin user doesn't exist on the production database.

SSH into your production server and try:

rake spree_auth:admin:create

Update:

Do this in /data/spree/current

like image 161
manishie Avatar answered Sep 23 '22 10:09

manishie