# Acts\_as\_authenticated error

**URL:** <https://www.ruby-forum.com/t/acts-as-authenticated-error/131468>\
**Category:** Rails\
**Created:** [March 10, 2008, 1:28pm UTC](https://www.ruby-forum.com/t/acts-as-authenticated-error/131468 "2008-03-10T13:28:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![capslock118](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/df705f/32.png) [@capslock118](https://www.ruby-forum.com/u/capslock118)\
**Post date:** [March 10, 2008, 1:28pm UTC](https://www.ruby-forum.com/t/acts-as-authenticated-error/131468/1 "2008-03-10T13:28:40Z")

</div>

I tried to use acts\_as\_authenticated on my site but I was getting some  
errors. I went to techno-weenie and found that they depreciated that for  
restful\_authentication instead.

Ok, so I follow the instructions as laid out here:  
[http://svn.techno-weenie.net/projects/plugins/acts\_as\_authenticated/README](http://svn.techno-weenie.net/projects/plugins/acts_as_authenticated/README)

Also in the book I purchased “rails cookbook”

Well I place in one of my controllers before\_filter :login\_required and  
I get this error:  
"undefined method `authenticate\_with\_http\_basic’ for  
#UsersAddressController:0x2aaaac214b30  
"

Now I have been reading as much as I can online but I am not getting  
anywhere. I think it may just be that I do not fully understand the  
concept behind how this plugin works. When I was on the rails irc the  
other day I was told that my situation was hard to analyze because I did  
not provide any code.

What code exactly? I assume that I am able to place in before\_filter  
:login\_required on any given controller and that would be the end of it  
minus creating accounts. Am I mis-understood? Also, when I use this  
line:  
script/generate authenticated user sessions --include-activation  
–stateful  
I am not able to pull up any basic login/out pages as the templates are  
missing?

I would not use basic templates in production to begin with but my point  
here is I cannot seem to get the basics working and I think I am just  
missing the point of this plugin.

Does anyone have any insight?

---

<div class="post-metadata">

**Author:** ![capslock118](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/df705f/32.png) [@capslock118](https://www.ruby-forum.com/u/capslock118)\
**Post date:** [March 10, 2008, 1:38pm UTC](https://www.ruby-forum.com/t/acts-as-authenticated-error/131468/2 "2008-03-10T13:38:23Z")

</div>

On Mar 10, 12:28 pm, Joel S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> "undefined method `authenticate\_with\_http\_basic’ for  
> #UsersAddressController:0x2aaaac214b30  
> "

What version of Rails are you using? authenticate\_with\_http\_basic was  
introduced in Rails 2.0.

Regards

Robin

---

<div class="post-metadata">

**Author:** ![capslock118](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/df705f/32.png) [@capslock118](https://www.ruby-forum.com/u/capslock118)\
**Post date:** [March 12, 2008, 1:30pm UTC](https://www.ruby-forum.com/t/acts-as-authenticated-error/131468/3 "2008-03-12T13:30:38Z")

</div>

On Mar 10, 4:38 pm, Joel S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Is there a way that my rails app, which was installed in 1.4, is still  
> using 1.4 even though gem list says 2.0.2?

You can force rails to use a specific version by editing your  
environment.rb file. You need to set the RAILS\_GEM\_VERSION to 2.0.2.  
It is probably at 1.4 if your app was created before the update.

Robin

---

<div class="post-metadata">

**Author:** ![capslock118](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/df705f/32.png) [@capslock118](https://www.ruby-forum.com/u/capslock118)\
**Post date:** [March 10, 2008, 5:38pm UTC](https://www.ruby-forum.com/t/acts-as-authenticated-error/131468/4 "2008-03-10T17:38:08Z")

</div>

Robin F. wrote:

> On Mar 10, 12:28ï¿½pm, Joel S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > "undefined method `authenticate\_with\_http\_basic’ for  
> > #UsersAddressController:0x2aaaac214b30  
> > "
> 
> What version of Rails are you using? authenticate\_with\_http\_basic was  
> introduced in Rails 2.0.
> 
> Regards
> 
> Robin

Thats a good question. Using gem list I see 2.0.2. Now there is a  
caveate with that I think…

First, I installed via Ubuntu’s synaptic rails 1.4 prior to 2.0.2. I was  
trying to use acts\_as\_authenticated then and I quickly learned through  
google that I needed \> 2.0. So I used gem install to get 2.0. - I  
believe synaptic package manager still believes I have 1.4 installed  
(maybe I should remove that?)

Once that was installed I shut-down/start-up the rails server. I also  
noticed that in my environment.rb that RAILS\_GEM\_VERSION was still 1.4.  
So I simply changed that number to reflect what was in gem list.

Is that an issue?

I was thinking I might want to backup my  
controllers/views/models/migrates/etc and just rebuild the application?  
I do not see why it should come to that though so I am holding back from  
that option.

Is there a way that my rails app, which was installed in 1.4, is still  
using 1.4 even though gem list says 2.0.2?
