I'm trying to use the recaptcha gem with devise 2.0.0 in rails 3.2.1.

Every time I try, I am able to display the captcha and input the 2
words it asks about. But in my controller (using code I found on
github for the recaptcha gem, and after I replaced render_with_context
with just plain render) verify_recaptcha always returns false and when
I look at flash[:recaptcha_error] it says "recaptcha-not-reachable".
The only thing I can see that might be a problem is that one of the
examples of configuring the config values for recaptcha showed a proxy
setting. I don't generally use a proxy so I just left that setting
out. Is there some reason why sending the captcha results to the
recaptcha server would require a proxy when getting the basic captcha
to display works just fine without one? Any other hints about what
might be wrong? Is there a better solution I should look at instead?

Thanks!

Ray

--
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@googlegroups.com.
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.

Search Discussions

  • Ray Bovet at Feb 13, 2012 at 10:13 am
    I did a little research inside the recaptcha gem code and discovered
    that "recaptcha-not-reachable" means that the code timed out before it
    got a response from the recaptcha website. Turns out the default
    timeout value is set at only 3 seconds. I was able to resolve the
    problem by changing the call to verify_recaptcha so that it included a
    higher timeout value:

    if verify_recaptcha( :model => resource, :timeout => 30)

    did the trick nicely.

    While I think that 3 seconds is a little short for the default timeout,
    I was really pleased at what a simple mechanism was already in place to
    alter it!

    Ray
    On 2/12/2012 9:13 AM, Ray Bovet wrote:
    I'm trying to use the recaptcha gem with devise 2.0.0 in rails 3.2.1.

    Every time I try, I am able to display the captcha and input the 2
    words it asks about. But in my controller (using code I found on
    github for the recaptcha gem, and after I replaced render_with_context
    with just plain render) verify_recaptcha always returns false and when
    I look at flash[:recaptcha_error] it says "recaptcha-not-reachable".
    The only thing I can see that might be a problem is that one of the
    examples of configuring the config values for recaptcha showed a proxy
    setting. I don't generally use a proxy so I just left that setting
    out. Is there some reason why sending the captcha results to the
    recaptcha server would require a proxy when getting the basic captcha
    to display works just fine without one? Any other hints about what
    might be wrong? Is there a better solution I should look at instead?

    Thanks!

    Ray
    --
    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@googlegroups.com.
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedFeb 13, '12 at 10:13a
activeFeb 13, '12 at 10:13a
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Ray Bovet: 1 post Ray Bovet: 1 post

People

Translate

site design / logo © 2022 Grokbase