Search code examples
ruby-on-railspostgresqlspree

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?


Solution

  • 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