GeoRuby and Authlogic?

6 views
Skip to first unread message

Ed

unread,
Aug 30, 2009, 1:27:17 PM8/30/09
to georuby
Is anyone using GeoRuby and Authlogic together?

I'm new to Rails, but I've set up a very simple application that only
lets me register and log in and out useing Authlogic. This works fine.

Then I added GeoRuby to the application and I get the error "wrong
number of arguments (1 for 2)" when the current_user is called in the
view.

GeoRuby and Authlogic seem to be perfect individually for my app, so
it'd be great if someone could point me towards getting them to work
together.

Cheers,

Ed.

Daniel Cohen

unread,
Aug 30, 2009, 1:49:02 PM8/30/09
to geo...@googlegroups.com, georuby
Hi Ed-

Shouldn't be a conflict between authlogic and georuby... perhaps you
could send us your entire stack trace so we can see exactly where the
problem is occurring. Also, rdebug is a great Ruby debugger that you
might find helpful.

Daniel

Ed

unread,
Aug 30, 2009, 1:59:31 PM8/30/09
to georuby
Thanks for the quick reply. It's encouraging to know that they
_should_ work together.

The full error page can be found here: http://edeverett.co.uk/examples/rails_error.htm
(that's not the app)

I'm running Rails 2.3.2 on Ruby 1.8.6 and the most up to date versions
of Authlogic and GeoRuby.

Thanks again for your time.

Ed



On Aug 30, 6:49 pm, Daniel Cohen <daniel.michael.co...@gmail.com>
wrote:
> Hi Ed-
>
> Shouldn't be a conflict between authlogic and georuby... perhaps you  
> could send us your entire stack trace so we can see exactly where the  
> problem is occurring. Also, rdebug is a great Ruby debugger that you  
> might find helpful.
>
> Daniel
>

Ed

unread,
Aug 30, 2009, 2:02:35 PM8/30/09
to georuby
Oh, and I was following the tutorial here : http://railscasts.com/episodes/160-authlogic
to set up the basic app. I think the error has to do with the code in
the application controller shown there.

Daniel Cohen

unread,
Aug 30, 2009, 8:47:14 PM8/30/09
to geo...@googlegroups.com
Hi Ed-

two potential quick-fixes: 

- Have you restarted your application after you installed the georuby gem?

- Perhaps try <% if current_user.blank? %> on index.html.erb:5.

I'm not at my computer right now, but at first glance, it looks like there could potentially be a problem with your sessions. Mainly @


C:/SVN/trunk/location0_8/app/controllers/application_controller.rb:14:in `current_user_session'
C:/SVN/trunk/location0_8/app/controllers/application_controller.rb:19:in `current_user'

Have you tried simply clearing your browse cache? Have you tried using ActiveRecord rather than cookies for session storage?

It looks like the method current_user in the application_controller is expecting 2 arguments, and only one is being passed in. So perhaps some method in current_user is unexpectedly returning nil.  To identify where thing are going wrong, try a debugger. Install rdebug: (gem install ruby-debug). Right before application_controller line 14, type "debugger" to make a breakpoint. Then restart your app using rdebug: "rdebug script/server". Here's a nice resource to get going with rdebug: http://cheat.errtheblog.com/s/rdebug/.

Let me know how it goes.
dc
--
Daniel Cohen
441 Rochambeau Avenue
Providence, RI 02906
(401) 688-0171

http://www.webmapps.com
http://thenice.tumblr.com
                                               
Reply all
Reply to author
Forward
0 new messages