Rzepak G.
2009-Aug-02 17:01 UTC
NoMethodError in User sessionsController#create - Authlogic
Hi, I''m beginner in rails, and I wanted to add to my simple application Authlogic. So I''ve watched http://railscasts.com/episodes/160-authlogic and step-by-step done everything. And almost everything works fine, except login in. After registration new user is automatically logged in, he can edit his profile, but after clicking logout and trying to login again I get error NoMethodError in User sessionsController#create undefined method `mb_chars'' for "rzepak":String My user_session_controller.rb: class UserSessionsController < ApplicationController def new @user_session = UserSession.new end def create @user_session = UserSession.new(params[:user_session]) if @user_session.save flash[:notice] = "Successfully logged in." redirect_to root_url else render :action => ''new'' end end def destroy current_user_session.destroy flash[:notice] = "Successfully logged out." redirect_to root_url end end I was trying to google this error, but with no success, so I hope I will find some help here gem -v 1.3.5 ruby -v ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] -- Posted via http://www.ruby-forum.com/.
Eric
2009-Aug-02 18:06 UTC
Re: NoMethodError in User sessionsController#create - Authlogic
On Aug 2, 10:01 am, "Rzepak G." <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > I''m beginner in rails, and I wanted to add to my simple application > Authlogic. So I''ve watchedhttp://railscasts.com/episodes/160-authlogic > and step-by-step done everything. And almost everything works fine, > except login in. After registration new user is automatically logged in, > he can edit his profile, but after clicking logout and trying to login > again I get error > > NoMethodError in User sessionsController#create > > undefined method `mb_chars'' for "rzepak":String > > My user_session_controller.rb: > > class UserSessionsController < ApplicationController > def new > @user_session = UserSession.new > end > > def create > @user_session = UserSession.new(params[:user_session]) > if @user_session.save > flash[:notice] = "Successfully logged in." > redirect_to root_url > else > render :action => ''new'' > end > end > > def destroy > current_user_session.destroy > flash[:notice] = "Successfully logged out." > redirect_to root_url > end > > end > > I was trying to google this error, but with no success, so I hope I will > find some help here > > gem -v 1.3.5 > ruby -v ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]You didn''t post your view, but, maybe a typo via "User sessionsController"?
Rzepak G.
2009-Aug-02 18:14 UTC
Re: NoMethodError in User sessionsController#create - Authlogic
it''s just user_sessions - new.html.erb <% title "Login" %> <% form_for @user_session do |f| %> <%= f.error_messages %> <p> <%= f.label :username %><br /> <%= f.text_field :username %> </p> <p> <%= f.label :password %><br /> <%= f.password_field :password %> </p> <p><%= f.submit "Submit" %></p> <% end %> and it was created automatically.. i didn''t change to much in code.. -- Posted via http://www.ruby-forum.com/.
Eric
2009-Aug-02 18:17 UTC
Re: NoMethodError in User sessionsController#create - Authlogic
On Aug 2, 11:14 am, "Rzepak G." <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> it''s just > user_sessions - new.html.erb > <% title "Login" %> > > <% form_for @user_session do |f| %> > <%= f.error_messages %> > <p> > <%= f.label :username %><br /> > <%= f.text_field :username %> > </p> > <p> > <%= f.label :password %><br /> > <%= f.password_field :password %> > </p> > <p><%= f.submit "Submit" %></p> > <% end %> > > and it was created automatically.. i didn''t change to much in code.. > -- > Posted viahttp://www.ruby-forum.com/.OK, but do you see anything strange about: "User sessionsController"?
Rzepak G.
2009-Aug-02 18:25 UTC
Re: NoMethodError in User sessionsController#create - Authlogic
Hmm, it looks strange, but I''ve checked all files and there''s no typo, I even overwrite some code with code from screencast post, but still there''s the same bug. I think it''s connected with "undefined method `mb_chars'' for "rzepak":String" but I don''t know what to do with it -- Posted via http://www.ruby-forum.com/.
Rzepak G.
2009-Aug-02 18:34 UTC
Re: NoMethodError in User sessionsController#create - Authlogic
vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/login.rb:121:in `find_with_case'' vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/login.rb:110:in `find_by_smart_case_login_field'' vendor/plugins/authlogic/lib/authlogic/session/scopes.rb:95:in `send'' vendor/plugins/authlogic/lib/authlogic/session/scopes.rb:95:in `search_for_record'' vendor/rails/activerecord/lib/active_record/base.rb:1852:in `with_scope'' vendor/plugins/authlogic/lib/authlogic/session/scopes.rb:94:in `send'' vendor/plugins/authlogic/lib/authlogic/session/scopes.rb:94:in `search_for_record'' vendor/plugins/authlogic/lib/authlogic/session/password.rb:178:in `validate_by_password'' vendor/rails/activesupport/lib/active_support/callbacks.rb:173:in `send'' vendor/rails/activesupport/lib/active_support/callbacks.rb:173:in `evaluate_method'' vendor/rails/activesupport/lib/active_support/callbacks.rb:161:in `call'' vendor/rails/activesupport/lib/active_support/callbacks.rb:93:in `run'' vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `each'' vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `send'' vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `run'' vendor/rails/activesupport/lib/active_support/callbacks.rb:272:in `run_callbacks'' vendor/plugins/authlogic/lib/authlogic/session/callbacks.rb:71:in `validate'' vendor/plugins/authlogic/lib/authlogic/session/validation.rb:62:in `valid?'' vendor/plugins/authlogic/lib/authlogic/session/existence.rb:65:in `save'' app/controllers/user_sessions_controller.rb:8:in `create'' -- Posted via http://www.ruby-forum.com/.
Hi, I had the same issue - I think it has something to do with the latest version of Authlogic possibly requiring Ruby 1.9???, whereas I''m running 1.8.6 on my dev machine and I see you''re running 1.8.7. The commit 53834196c8f82cac6b105126e3d267246b7b2b67 from July 2, 2009 seems to be the issue: Use mb_chars when downcasing login to deal with international characters Specifying the previous gem version in my Rails environment seemed to do the trick: config.gem ''authlogic'', :version => "= 2.1.0" Let me know how it goes. On Aug 3, 4:34 am, "Rzepak G." <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/login.rb:121:in > `find_with_case'' > vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/login.rb:110:in > `find_by_smart_case_login_field'' > vendor/plugins/authlogic/lib/authlogic/session/scopes.rb:95:in `send'' > vendor/plugins/authlogic/lib/authlogic/session/scopes.rb:95:in > `search_for_record'' > vendor/rails/activerecord/lib/active_record/base.rb:1852:in `with_scope'' > vendor/plugins/authlogic/lib/authlogic/session/scopes.rb:94:in `send'' > vendor/plugins/authlogic/lib/authlogic/session/scopes.rb:94:in > `search_for_record'' > vendor/plugins/authlogic/lib/authlogic/session/password.rb:178:in > `validate_by_password'' > vendor/rails/activesupport/lib/active_support/callbacks.rb:173:in `send'' > vendor/rails/activesupport/lib/active_support/callbacks.rb:173:in > `evaluate_method'' > vendor/rails/activesupport/lib/active_support/callbacks.rb:161:in `call'' > vendor/rails/activesupport/lib/active_support/callbacks.rb:93:in `run'' > vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `each'' > vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `send'' > vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `run'' > vendor/rails/activesupport/lib/active_support/callbacks.rb:272:in > `run_callbacks'' > vendor/plugins/authlogic/lib/authlogic/session/callbacks.rb:71:in > `validate'' > vendor/plugins/authlogic/lib/authlogic/session/validation.rb:62:in > `valid?'' > vendor/plugins/authlogic/lib/authlogic/session/existence.rb:65:in `save'' > app/controllers/user_sessions_controller.rb:8:in `create'' > -- > Posted viahttp://www.ruby-forum.com/.
Eric
2009-Aug-03 06:20 UTC
Re: NoMethodError in User sessionsController#create - Authlogic
I wrote an app today that used authlogic 2.1.1 on ruby 1.8.6 just fine. -eric On Aug 2, 8:04 pm, ado <adoni...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, I had the same issue - I think it has something to do with the > latest version of Authlogic possibly requiring Ruby 1.9???, whereas > I''m running 1.8.6 on my dev machine and I see you''re running 1.8.7. > > The commit 53834196c8f82cac6b105126e3d267246b7b2b67 from July 2, 2009 > seems to be the issue: > Use mb_chars when downcasing login to deal with international > characters > > Specifying the previous gem version in my Rails environment seemed to > do the trick: > config.gem ''authlogic'', :version => "= 2.1.0" > > Let me know how it goes. > > On Aug 3, 4:34 am, "Rzepak G." <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > > > > vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/login.rb:121:in > > `find_with_case'' > > vendor/plugins/authlogic/lib/authlogic/acts_as_authentic/login.rb:110:in > > `find_by_smart_case_login_field'' > > vendor/plugins/authlogic/lib/authlogic/session/scopes.rb:95:in `send'' > > vendor/plugins/authlogic/lib/authlogic/session/scopes.rb:95:in > > `search_for_record'' > > vendor/rails/activerecord/lib/active_record/base.rb:1852:in `with_scope'' > > vendor/plugins/authlogic/lib/authlogic/session/scopes.rb:94:in `send'' > > vendor/plugins/authlogic/lib/authlogic/session/scopes.rb:94:in > > `search_for_record'' > > vendor/plugins/authlogic/lib/authlogic/session/password.rb:178:in > > `validate_by_password'' > > vendor/rails/activesupport/lib/active_support/callbacks.rb:173:in `send'' > > vendor/rails/activesupport/lib/active_support/callbacks.rb:173:in > > `evaluate_method'' > > vendor/rails/activesupport/lib/active_support/callbacks.rb:161:in `call'' > > vendor/rails/activesupport/lib/active_support/callbacks.rb:93:in `run'' > > vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `each'' > > vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `send'' > > vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `run'' > > vendor/rails/activesupport/lib/active_support/callbacks.rb:272:in > > `run_callbacks'' > > vendor/plugins/authlogic/lib/authlogic/session/callbacks.rb:71:in > > `validate'' > > vendor/plugins/authlogic/lib/authlogic/session/validation.rb:62:in > > `valid?'' > > vendor/plugins/authlogic/lib/authlogic/session/existence.rb:65:in `save'' > > app/controllers/user_sessions_controller.rb:8:in `create'' > > -- > > Posted viahttp://www.ruby-forum.com/.
Jan metten Van der meer
2009-Aug-21 15:27 UTC
Re: NoMethodError in User sessionsController#create - Authlogic
Adam Hill wrote:> Hi, I had the same issue - I think it has something to do with the > latest version of Authlogic possibly requiring Ruby 1.9???, whereas > I''m running 1.8.6 on my dev machine and I see you''re running 1.8.7. > > The commit 53834196c8f82cac6b105126e3d267246b7b2b67 from July 2, 2009 > seems to be the issue: > Use mb_chars when downcasing login to deal with international > characters > > Specifying the previous gem version in my Rails environment seemed to > do the trick: > config.gem ''authlogic'', :version => "= 2.1.0" > > Let me know how it goes. > > On Aug 3, 4:34�am, "Rzepak G." <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>I had the same error. authlogic version 2.1.0 didn''t help. Changing rails version from 2.1.0 to 2.3.3 did. I''m using Ruby 1.8.6. -- Posted via http://www.ruby-forum.com/.
No Where
2009-Aug-23 03:00 UTC
Re: NoMethodError in User sessionsController#create - Authlogic
I''m having the same problem when using both a login field and an email field. I get the no method error for the email field in any view. If I remove the login field from the migration and the views all works fine. Im on rails 2.3.3 and ruby 1.8.7 I just installed the latest plugin and disabled the gem as suggested in Ben''s google group but no joy. Still looking for an answer... Eric -- Posted via http://www.ruby-forum.com/.
Karlw
2009-Sep-14 01:12 UTC
Re: NoMethodError in User sessionsController#create - Authlogic
On Aug 22, 11:00 pm, No Where <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I''m having the same problem when using both a login field and an email > field. I get the no method error for the email field in any view. If I > remove the login field from the migration and the views all works fine. > > Im on rails 2.3.3 and ruby 1.8.7 > > I just installed the latest plugin and disabled the gem as suggested in > Ben''s google group but no joy. > > Still looking for an answer...Is this issue still pending? No fix for the ruby 1.8.7 users?> > Eric > -- > Posted viahttp://www.ruby-forum.com/.
Amit Pandya
2010-May-19 18:34 UTC
Re: NoMethodError in User sessionsController#create - Authlogic
amit_pandya wrote: This things happens because of version conflict of authlogic, either upgrade or remove current one and install old one Adam Hill wrote:> Hi, I had the same issue - I think it has something to do with the > latest version of Authlogic possibly requiring Ruby 1.9???, whereas > I''m running 1.8.6 on my dev machine and I see you''re running 1.8.7. > > The commit 53834196c8f82cac6b105126e3d267246b7b2b67 from July 2, 2009 > seems to be the issue: > Use mb_chars when downcasing login to deal with international > characters > > Specifying the previous gem version in my Rails environment seemed to > do the trick: > config.gem ''authlogic'', :version => "= 2.1.0" > > Let me know how it goes. > > On Aug 3, 4:34�am, "Rzepak G." <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>-- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
flower g.
2011-May-23 09:49 UTC
Re: NoMethodError in User sessionsController#create - Authlogic
Hai, I am getting this type of error while connecting my application with facebook Please help me to fin solution for my problem NoMethodError in SessionsController#new You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occurred while evaluating nil.+ -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2011-May-23 10:18 UTC
Re: Re: NoMethodError in User sessionsController#create - Authlogic
On 23 May 2011 10:49, flower g. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hai, > I am getting this type of error while connecting my application with > facebook > Please help me to fin solution for my problem > > > NoMethodError in SessionsController#new > > You have a nil object when you didn''t expect it! > You might have expected an instance of Array. > The error occurred while evaluating nil.+This is nothing to do with the original subject of this thread. I suggest starting a new thread with an appropriate subject. First however examine the error message carefully and try and work out what it means. There should be a stack trace showing which line the error appeared on. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Possibly Parallel Threads
- Authlogic and rails 3 : NameError in User sessionsController#new
- AuthLogic Question - one time password (persistence_token) - what config is required to use this???
- NoMethodError in User sessionsController#new
- NoMethodError in User sessionsController#create
- RSpec with Rails 3.1rc4: spec test won't recognize <%= %> (should be simple)