Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authlogic throwing errors on Heroku

Yes, I've read this.

This is what I'm getting in my production.log:

ActionView::TemplateError (undefined method `password' for #<User:0x2b0ddb58cdc0>) on line #11 of app/views/users/new.html.erb:
8:         </p>
9:         <p>
10:           <%= f.label :password, "Password:" %><br />
11:           <%= f.password_field :password %>
12:         </p>
13:         <p>
14:           <%= f.label :password_confirmation, "Password again:" %><br />

When I try:

$ heroku rake db:reset RAILS_ENV=production

I get:

yeqynzfiku already exists
(in /disk1/home/slugs/109616_e6df6f2_8837/mnt)
Couldn't drop yeqynzfiku : #<ActiveRecord::StatementInvalid: PGError: ERROR:  must be owner of database yeqynzfiku
: DROP DATABASE IF EXISTS "yeqynzfiku">

I don't know what this means. I've also tried

$ heroku rake db:reset
$ heroku rake db:migrate RAILS_ENV=production
$ heroku rake db:migrate
$ heroku rake gems:install (for what it's worth)

Everything works fine locally, both in development and production modes. I have a .gems file in my app, and when I first pushed to Heroku it seemed to install AuthLogic and Paperclip just fine.

Stumped. Thanks.

like image 463
user225643 Avatar asked Jan 04 '10 04:01

user225643


3 Answers

Sounds like you solved it, but with problems like this I find it handy do do a heroku restart.

For example, after running migrations with heroku rake db:migrate the app needs to be restarted before it will see those new columns.

like image 89
Luke Francl Avatar answered Nov 07 '22 19:11

Luke Francl


Instead of db:reset try db:migrate VERSION=0 and db:migrate.
I think they have issues with reset because it tries to drop the db.
Also, you don't need to put RAILS_ENV=production it's the default AFAIK...

like image 2
Boris Churzin Avatar answered Nov 07 '22 19:11

Boris Churzin


I had the same problem. I did a heroku restart and it worked perfectly.

like image 2
christianrojas Avatar answered Nov 07 '22 17:11

christianrojas