Can't create admin user on Heroku
Posted
by
Nick5a1
on Stack Overflow
See other posts from Stack Overflow
or by Nick5a1
Published on 2012-06-27T20:53:34Z
Indexed on
2012/06/27
21:16 UTC
Read the original article
Hit count: 292
I am new to rails and I have gone through Kevin Skoglund's Ruby on Rails 3 Essential Training course on Lynda.com. Through the course you set up a simple cms, which I did. It doesn't cover Git or deployment but I've pushed my simple cms to github (https://github.com/nick5a1/Simple_CMS) and deployed to Heroku (http://nkarrasch.herokuapp.com/).
In order to deploy to Heroku I followed the Heroku setup guide (https://devcenter.heroku.com/articles/rails3) and switched my database from MySQL to PostgreSQL. As instructed I changed gen'mysql2' to gen 'sqlite3' in my Gemfile and ran bundle install before pushing. I then ran heroku run rake db:migrate
.
I'm running into 2 problems. When I try to log in (http://nkarrasch.herokuapp.com/access) I get an error "We're sorry, but something went wrong". I should instead be getting a flash message with invalid username/password combination. This is what I'm getting on my test environment on my local machine.
Secondly, when I log into the Heroku console to create and create an admin user, when I try to save that user I get the following error:
irb(main):004:0> user.save
(1.2ms) BEGIN
AdminUser Exists (1.9ms) SELECT 1 AS one FROM "admin_users" WHERE "admin_users"."username" = 'Nick5a1' LIMIT 1
(1.7ms) ROLLBACK
=> false
Any advice on how to troubleshoot would be greatly appreciated :).
Thanks very much, Nick
EDIT: Here are my Heroku logs:
2012-06-27T20:36:44+00:00 heroku[slugc]: Slug compilation started
2012-06-27T20:37:34+00:00 heroku[api]: Add shared-database:5mb add-on by [email protected]
2012-06-27T20:37:34+00:00 heroku[api]: Release v2 created by [email protected]
2012-06-27T20:37:34+00:00 heroku[api]: Add RAILS_ENV, LANG, PATH, RACK_ENV, GEM_PATH config by [email protected]
2012-06-27T20:37:34+00:00 heroku[api]: Release v3 created by [email protected]
2012-06-27T20:37:34+00:00 heroku[api]: Release v4 created by [email protected]
2012-06-27T20:37:34+00:00 heroku[api]: Deploy 1d82839 by [email protected]
2012-06-27T20:37:35+00:00 heroku[slugc]: Slug compilation finished
2012-06-27T20:37:36+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 45450`
2012-06-27T20:37:40+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2012-06-27T20:37:40+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2012-06-27T20:37:40+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2012-06-27T20:37:44+00:00 app[web.1]: => Rails 3.2.6 application starting in production on http://0.0.0.0:45450
2012-06-27T20:37:44+00:00 app[web.1]: => Call with -d to detach
2012-06-27T20:37:44+00:00 app[web.1]: => Booting WEBrick
2012-06-27T20:37:44+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2012-06-27T20:37:44+00:00 app[web.1]: => Ctrl-C to shutdown server
2012-06-27T20:37:44+00:00 app[web.1]: [2012-06-27 20:37:44] INFO WEBrick 1.3.1
2012-06-27T20:37:44+00:00 app[web.1]: [2012-06-27 20:37:44] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux]
2012-06-27T20:37:44+00:00 app[web.1]: [2012-06-27 20:37:44] INFO WEBrick::HTTPServer#start: pid=2 port=45450
2012-06-27T20:37:45+00:00 heroku[web.1]: State changed from starting to up
2012-06-27T20:39:44+00:00 heroku[run.1]: Awaiting client
2012-06-27T20:39:44+00:00 heroku[run.1]: Starting process with command `bundle exec rake db:migrate`
2012-06-27T20:39:44+00:00 heroku[run.1]: State changed from starting to up
2012-06-27T20:39:51+00:00 heroku[run.1]: Process exited with status 0
2012-06-27T20:39:51+00:00 heroku[run.1]: State changed from up to complete
2012-06-27T20:41:05+00:00 heroku[run.1]: Awaiting client
2012-06-27T20:41:05+00:00 heroku[run.1]: Starting process with command `bundle exec rails console`
2012-06-27T20:41:05+00:00 heroku[run.1]: State changed from starting to up
2012-06-27T20:46:09+00:00 heroku[run.1]: Process exited with status 0
2012-06-27T20:46:09+00:00 heroku[run.1]: State changed from up to complete
© Stack Overflow or respective owner