title: Can't create admin user on Heroku
body: <p>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 (<a href="https://github.com/nick5a1/Simple_CMS" rel="nofollow">https://github.com/nick5a1/Simple_CMS</a>) and deployed to Heroku (<a href="http://nkarrasch.herokuapp.com/" rel="nofollow">http://nkarrasch.herokuapp.com/</a>). </p>
  
  <p>In order to deploy to Heroku I followed the Heroku setup guide (<a href="https://devcenter.heroku.com/articles/rails3" rel="nofollow">https://devcenter.heroku.com/articles/rails3</a>) 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 <code>heroku run rake db:migrate</code>.</p>
  
  <p>I'm running into 2 problems. When I try to log in (<a href="http://nkarrasch.herokuapp.com/access" rel="nofollow">http://nkarrasch.herokuapp.com/access</a>) 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.</p>
  
  <p>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: </p>
  
  <pre><code>irb(main):004:0&gt; 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
  =&gt; false
  </code></pre>
  
  <p>Any advice on how to troubleshoot would be greatly appreciated :).</p>
  
  <p>Thanks very much,
  Nick</p>
  
  <p>EDIT: Here are my Heroku logs:</p>
  
  <pre><code>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 *
  2012-06-27T20:37:34+00:00 heroku[api]: Release v2 created by *
  2012-06-27T20:37:34+00:00 heroku[api]: Add RAILS_ENV, LANG, PATH, RACK_ENV, GEM_PATH config by *
  2012-06-27T20:37:34+00:00 heroku[api]: Release v3 created by *
  2012-06-27T20:37:34+00:00 heroku[api]: Release v4 created by *
  2012-06-27T20:37:34+00:00 heroku[api]: Deploy 1d82839 by *
  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 &lt;top (required)&gt; 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 &lt;top (required)&gt; 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 &lt;top (required)&gt; at /app/config/environment.rb:5)
  2012-06-27T20:37:44+00:00 app[web.1]: =&gt; 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]: =&gt; Call with -d to detach
  2012-06-27T20:37:44+00:00 app[web.1]: =&gt; 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]: =&gt; 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
  </code></pre>