Help with error - uninitialized constant AuthenticatedSystem::Base64

I am using restful_Authentication plugin combined with the built-in
http_basic authentication Rails 2.0.2

The following code in my controller seemed to work fine,

  1. before_filter :authenticate
  2. def authenticate
  3.   case request.format
    
  4.   when Mime::XML, Mime::ATOM
    
  5.         if user = authenticate_with_http_basic { |name,
    

pass| User.authenticate(name, pass) }
7. @current_user = user
8. else
9. request_http_basic_authentication
10. end
11. else
12. login_required if action_name != ‘index’
13. return true
14. end
15. end

Then I started seeing this error whenever I accessed any action in my
controller
and also while accessing the login, logout actions as well.
I can’t seem to get rid of it.

NameError in MyController#index

uninitialized constant AuthenticatedSystem::Base64

RAILS_ROOT: C:/railsapps/Myapp
Application Trace | Framework Trace | Full Trace

vendor/rails/activesupport/lib/active_support/dependencies.rb:263:in
load_missing_constant' vendor/rails/activesupport/lib/active_support/dependencies.rb:453:inconst_missing’
lib/authenticated_system.rb:126:in get_auth_data' lib/authenticated_system.rb:105:inlogin_from_basic_auth’
lib/authenticated_system.rb:12:in current_user' lib/authenticated_system.rb:6:inlogged_in?’
lib/authenticated_system.rb:34:in authorized?' lib/authenticated_system.rb:52:inlogin_required’
app/controllers/opinions_controller.rb:166:in `authenticate’
script\server:3

Can anybody shed some light on this?

Thanks

The answer to your question is beyond my skill level. but I did find
this:

http://dev.rubyonrails.org/changeset/7091
and
http://pastie.org/pastes/216469

I think you are missing a require ‘base64’ in HttpAuthentication

good luck

I looked at this some more.
Reading the files named HttpAuthentication,rb in both 2.0.2 and 2.1
rails stacks,
the 2.0.2 file contains require ‘base64’ and the 2.1 does not.

I don’t know why. I assume it was moved upstream or downstream.

Did this problem start about the time you installed 2.1? seems
something is out of sync

1.8/gems/actionpack-2.0.2/lib/action_controller/HttpAuthentication,rb

Good Luck

On 18 Jun 2008, at 14:11, Ruby F. wrote:

I looked at this some more.
Reading the files named HttpAuthentication,rb in both 2.0.2 and 2.1
rails stacks,
the 2.0.2 file contains require ‘base64’ and the 2.1 does not.

The base64 library is deprecated (and remove in 1.9), hence the
removal of the dependency in 2.1 ( use pack/unpack with the m*
directive). Seems like it’s also gone in ruby 1.8.7 (which backported
a lot of the stdlib changes from 1.9).
Don’t run rails 2.0.2 on ruby 1.8.7. It’s not ready for it (2.1 is)

Fred