Skip to content
This repository

net/http #7

Closed
jerome opened this Issue October 02, 2009 · 5 comments

5 participants

Jérôme Lipowicz Artiom Di Jason L Perry Maurizio De Magnis Simon Courtois
Jérôme Lipowicz

Hi

Using ruby 1.8.7, rails 2.3.4 and recaptcha 0.2.2 as a gem, require 'net/http' is mandatory in environment.rb else the verify_captcha method raises a Recaptcha::RecaptchaError exception "uninitialized constant Net::HTTP"

Please require 'net/http' in the init.rb :)

Best

Artiom Di

+1

Jason L Perry
Owner

Requiring 'net/http'. Closed by db7ac33

Maurizio De Magnis

I still get this error:
Recaptcha::RecaptchaError (uninitialized constant Recaptcha::Verify::Net):

when calling verify_recaptcha within my Rails controller.

My environment:

$ gem --version
1.5.0
$ ruby --version
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.5.0]
$ rvm version
rvm 1.2.5 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]
$ uname -a
Darwin devuby 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386 i386
$ rails --version
Rails 3.0.3
$ gem list recaptcha
*** LOCAL GEMS ***
recaptcha (0.3.1)

The weird fact if that it starts working if I move require 'net/http' from init.rb to the top of lib/recaptcha/rails.rb

Maurizio De Magnis

As a temporary hack you can add require 'net/http' just before require 'rails/all' in your Rails 3 config/application.rb

Simon Courtois

I get this error too, using Ruby 1.9.2, Rails 3.1.1 and reCaptcha 0.3.1.

Pavel Tsiukhtsiayeu PavelTyk referenced this issue from a commit in PavelTyk/recaptcha February 02, 2011
Maurizio De Magnis this should fix issue #7 a6ff541
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.