Ok this is getting very frustrating, one problem after the next. I pushed my app to heroku and when I visit the url I get my login screen (as I should). But when I actually try to login it gives me the "Invalid Username/Password" warning message. However everything works fine on my localhost. I'm assuming there is a problem with the app communicating with my database. I've ran "heroku run rake db:migrate" and no luck.
On my localhost I'm using the standard sqlite3 database but I had to include the gem 'pg' in my gem file when pushing it to heroku to avoid errors. When I left it as gem sqlite3 i received an error saying it couldn't find sqlite3.h file or something of that nature.
I can see that my database is living on postgres.heroku.com. I've also installed this gem via the recommendation of heroku support
gem 'activerecord-postgresql-adapter'
Here are some logs from heroku when I try to enter the login info. Any help is greatly appreciated.
←[36m2013-04-04T14:31:15+00:00 app[web.1]:←[0m Started POST "/session" for 74.143.68.203 at 2013-04-04 14:31:15 +0000
←[36m2013-04-04T14:31:15+00:00 app[web.1]:←[0m Processing by SessionsController#create as HTML
←[36m2013-04-04T14:31:15+00:00 app[web.1]:←[0m Parameters: {"utf8"=>"???", "authenticity_token"=>"rQ1i9DRCV3qju2+RSBwp/9XYW8+6RiLfKfGZFNEcbT8=", "email"=>"admin@ciagent.com", "password"=>"[FILTERED]", "commit"=>"Login"}
←[36m2013-04-04T14:31:15+00:00 app[web.1]:←[0m Rendered sessions/new.html.erb within layouts/application (0.9ms)
←[36m2013-04-04T14:31:15+00:00 app[web.1]:←[0m Completed 200 OK in 4ms (Views: 2.2ms | ActiveRecord: 1.2ms)
←[33m2013-04-04T14:31:16+00:00 heroku[router]:←[0m at=info method=GET path=/favicon.ico host=boiling-reef-2060.herokuapp.com fwd="74.143.68.203" dyno=web.1 connect=2ms service=7ms status=304 bytes=0
←[33m2013-04-04T14:31:15+00:00 heroku[router]:←[0m at=info method=POST path=/session host=boiling-reef-2060.herokuapp.com fwd="74.143.68.203" dyno=web.1 connect=1ms service=12ms status=200 bytes=1721
I just don't understand why I can login when my app is on localhost with the same username/pw but when the app is on heroku it can't recognize the login info.
ADDITIONAL EDIT ______________
I opened up the console for my local app and found what I expected when looking for a user:
$ rails c
Loading development environment (Rails 3.2.13)
irb(main):001:0> user=User.find(1)
←[1m←[36mUser Load (5.0ms)←[0m ←[1mSELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1←[0m [["id", 1]]
=> #<User id: 1, email: "admin@ciagent.com", hashed_password: "dc009272b087019fb2b20b691dc827dca1424a1a", created_at: "2010-10-29 19:43:00", updated_at: "2011-01-12 20:07:09", admin: "yes", logo: nil>
When I looked for this when I opened the console on heroku here is the error I received. I'll keep searching for the fix but maybe you guys will see an obvious red flag.
Connecting to database specified by DATABASE_URL
Loading production environment (Rails 3.2.13)
irb(main):001:0> user=User.find(1)
user=User.find(1)
User Load (39.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
ActiveRecord::RecordNotFound: Couldn't find User with id=1
from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/relation/finder_methods.rb:343:in `find_one'
from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/relation/finder_methods.rb:314:in `find_with_ids'
from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/relation/finder_methods.rb:107:in `find'
from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/querying.rb:5:in `find' from (irb):1
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands/console.rb:47:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands/console.rb:8:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'