uninitialized constant User::Authentication

I've hosted acts-as-blogr on Slicehost for a while now, but I recently signed up for shared hosting through Dreamhost.  They had a promotion of 2 years of hosting for $22 which I couldn't pass up now that they support Passenger for Rails apps.  Anyway, I finally got around to deploying an app with Passenger and I had a little problem.

Upon doing the initial 'cap deploy:migrations', it failed with this error

  * executing "cd /home/brentmc79/brentmc79.com/releases/20090122070240; rake RAILS_ENV=production  db:migrate"
    servers: ["brentmc79.com"]
    [brentmc79.com] executing command
 ** [out :: brentmc79.com] (in /home/brentmc79/brentmc79.com/releases/20090122070240)
 ** [out :: brentmc79.com] rake aborted!
 ** [out :: brentmc79.com] uninitialized constant User::Authentication
 ** [out :: brentmc79.com] 
 ** [out :: brentmc79.com] (See full trace by running task with --trace)
    command finished
failed: "sh -c \"cd /home/brentmc79/brentmc79.com/releases/20090122070240; rake RAILS_ENV=production  db:migrate\"" on brentmc79.com

This was clearly something to do with restful_authentication since it was complaining about User::Authentication.  I did a bit of googling, but I didn't come up with much.  Somebody mentioned renaming the plugin to not have a hyphen, but that just seemed silly.  Someone else mentioned some session/cookie issue, but I hadn't even made it to the browser.  It was failing on db:migrate.  Finally, someone mentioned that they had forgotten to include the plugin in their repo.  This got me to thinkin...

I knew that I had included the plugin, but I decided to take a look at the Github repo in the browser.  Here's what I saw:

 

The restful_authentication plugin was actually a cloned repo sitting inside my working copy.  I'm sure there's probably some clever way to enable a repo inside of a repo, but it was 2am and I just wanted it to work.  So I just rm'd the restful_authentication plugin from the vendor directory, download the tarball from Github, and extracted it back into vendor/plugins.  Using the tarball instead of the clone gives you all the code without all the git info.

I committed/pushed, then ran 'cap deploy:migrations' again and the database migrated with no uninitialized constant error.   Viola!  Unfortunately, then I just moved on to the next issue...

After a couple more tweaks and deploys, I finally had it up and running.

restful_authentication error

 

Comments (8)


avatar

NIce, had this exact same problem. Good job!

avatar

Likely what you needed to do in your app root was a: git submodule init git submodule update

avatar

Yeah, you're probably right, but after my recent experience with submodules, I think I'm fine with just using the tarball.

avatar

Thanks for posting this. Worked for me!

avatar

Had the same problem as well - really was scratching my head - thanks so much!

avatar

Wow, thanks for posting this. I was about at my wit's end. And now my app is up and running!

avatar

Thanks for your post!. Solved my problem too.

avatar

Thanks for putting this up - you've helped me locate the problem I was running into.

Leave a Comment


 Name is required
 Email is required