I have followed the Spree instructions for setting up, and I got it working in development mode. I deployed with Capistrano to rackspace to a production server, but the same default login ("[email protected]"/"spree123") does not work. I created a user in the web interface, but of course it would not have admin priveleges.
There is nothing in the guide that takes this into account - how can I create an admin user in production when there are no users at all initially? Maybe I deployed incorrectly? I am using a very standard deploy.rb, must there be some spree-specific code for setting this up?
You can run rake spree_auth:admin:create
if your using spree_auth_devise
You can add any user to the Spree Admin Role from the console rails c
, doing the following:
user = user.find({your id})
user.spree_roles << Spree::Role.find_by_name(:admin)
In production, you would run the console this way:
RAILS_ENV=production rails c
If you are deploying with heroku make sure to do following:
heroku run rake db:migrate
heroku run rake db:seed
The seed will ask you to create a username and password for your admin account.
Hope this helped.
If the user you created was the first user it would in fact have admin rights.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With