CAPTCHA gem

Discussion in 'Ruby' started by Ss Kk, May 15, 2008.

  1. Ss Kk

    Ss Kk Guest

    Hi All,

    I am using 'captcha gem' in my code to implement 'CAPTCHA' functionality
    ,It gives following error :
    ---------------------------------------------------------------------------------------------------------
    MissingSourceFile in UserController#sign_in

    no such file to load -- GD

    RAILS_ROOT: ./script/../config/..
    Application Trace | Framework Trace | Full Trace

    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `gem_original_require'
    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
    `new_constants_in'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/captcha-0.1.2/lib/captcha.rb:22
    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
    `gem_original_require'
    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
    `new_constants_in'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
    `require'
    #{RAILS_ROOT}/app/controllers/user_controller.rb:9

    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `gem_original_require'
    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
    `new_constants_in'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/captcha-0.1.2/lib/captcha.rb:22
    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
    `gem_original_require'
    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
    `new_constants_in'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:203:in
    `load_without_new_constant_marking'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:203:in
    `load_file'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
    `new_constants_in'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:202:in
    `load_file'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:94:in
    `require_or_load'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:248:in
    `load_missing_constant'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:452:in
    `const_missing'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:464:in
    `const_missing'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/inflector.rb:250:in
    `constantize'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/string/inflections.rb:148:in
    `constantize'
    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/routing.rb:1284:in
    `recognize'
    d:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:40:in
    `dispatch'
    d:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:113:in
    `handle_dispatch'
    d:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:79:in
    `service'
    d:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
    d:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
    d:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
    d:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
    d:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
    d:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
    d:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
    d:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
    d:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
    d:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
    d:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:63:in
    `dispatch'
    d:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/webrick.rb:59
    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `gem_original_require'
    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
    `new_constants_in'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39
    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `gem_original_require'
    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `require'
    script/server:3

    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `gem_original_require'
    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
    `new_constants_in'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/captcha-0.1.2/lib/captcha.rb:22
    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
    `gem_original_require'
    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
    `new_constants_in'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
    `require'
    #{RAILS_ROOT}/app/controllers/user_controller.rb:9
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:203:in
    `load_without_new_constant_marking'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:203:in
    `load_file'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
    `new_constants_in'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:202:in
    `load_file'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:94:in
    `require_or_load'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:248:in
    `load_missing_constant'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:452:in
    `const_missing'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:464:in
    `const_missing'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/inflector.rb:250:in
    `constantize'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/string/inflections.rb:148:in
    `constantize'
    d:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/routing.rb:1284:in
    `recognize'
    d:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:40:in
    `dispatch'
    d:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:113:in
    `handle_dispatch'
    d:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:79:in
    `service'
    d:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
    d:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
    d:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
    d:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
    d:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
    d:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
    d:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
    d:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
    d:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
    d:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
    d:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:63:in
    `dispatch'
    d:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/webrick.rb:59
    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `gem_original_require'
    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
    `new_constants_in'
    d:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
    `require'
    d:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39
    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `gem_original_require'
    d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    `require'
    script/server:3

    This error occurred while loading the following files:
    captcha
    GD

    Request

    Parameters: None

    Show session dump

    ---
    :user_id:
    :fr: {}

    flash: !map:ActionController::Flash::FlashHash {}


    Response
    Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"}
    ---------------------------------------------------------------------------------------------------------
    I have installed gem gd1.1 ,Still it's not working.

    Tell me if anyone can help me to come out of this problem?
    --
    Posted via http://www.ruby-forum.com/.
     
    Ss Kk, May 15, 2008
    #1
    1. Advertisements

  2. Ss Kk

    Axel Etzold Guest

    -------- Original-Nachricht --------
    > Datum: Thu, 15 May 2008 17:55:06 +0900
    > Von: Ss Kk <>
    > An:
    > Betreff: CAPTCHA gem


    > Hi All,
    >
    > I am using 'captcha gem' in my code to implement 'CAPTCHA' functionality
    > ,It gives following error :
    > ---------------------------------------------------------------------------------------------------------
    > MissingSourceFile in UserController#sign_in
    >
    > no such file to load -- GD
    >
    > RAILS_ROOT: ./script/../config/..
    > Application Trace | Framework Trace | Full Trace
    >
    > d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    > `gem_original_require'
    > d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    > `require'
    >


    Hello,

    do you require rubygems in your script, ie., do you have a line

    require "rubygems"

    before

    require "captcha" ...

    in your script ?
    Maybe you can post some shortened bit of code ...

    Best regards,

    Axel



    --
    GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
    Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx
     
    Axel Etzold, May 15, 2008
    #2
    1. Advertisements

  3. Ss Kk

    Ss Kk Guest

    Axel Etzold wrote:
    > -------- Original-Nachricht --------
    >> Datum: Thu, 15 May 2008 17:55:06 +0900
    >> Von: Ss Kk <>
    >> An:
    >> Betreff: CAPTCHA gem

    >
    >> Application Trace | Framework Trace | Full Trace
    >>
    >> d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    >> `gem_original_require'
    >> d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    >> `require'
    >>

    >
    > Hello,
    >
    > do you require rubygems in your script, ie., do you have a line
    >
    > require "rubygems"
    >
    > before
    >
    > require "captcha" ...
    >
    > in your script ?
    > Maybe you can post some shortened bit of code ...
    >
    > Best regards,
    >
    > Axel


    Hi,
    Thanks for your reply Butit is not making any change ,Still same
    error


    Here is code of my user controller:
    require 'rubygems'
    require 'captcha'//Gives error to this line

    class UserController < ApplicationController

    def register
    var= CAPTCHA::Web.new
    var.to_html("captcha_temp")
    end
    end

    And code of Captcha file: ,you will get :

    "D:\ruby\lib\ruby\gems\1.8\gems\captcha-0.1.2\lib\captcha.rb"
    (If installed Captha gem)


    Tell me what's going wrong.
    --
    Posted via http://www.ruby-forum.com/.
     
    Ss Kk, May 15, 2008
    #3
  4. Ss Kk wrote:
    > Hi All,
    >
    > I am using 'captcha gem' in my code to implement 'CAPTCHA'
    > functionality ,It gives following error :
    >

    ---------------------------------------------------------------------------------------------------------
    > MissingSourceFile in UserController#sign_in
    >
    > no such file to load -- GD
    >
    > RAILS_ROOT: ./script/../config/.. Application Trace | Framework Trace
    > | Full Trace
    >
    > d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    > `gem_original_require'

    Well, from what you posted, require 'rubygems' is done somewhere in the
    code you load (that's the custom_require line right there) and I guess
    the captcha gem tries to load GD and cannot find it.
    So your problem is either that GD is not correctly installed or that you
    don't have the correct GD version.
    Try to isolate the problem by making a small unit test of just a test
    program that does only the one thing you're trying to do here:

    require 'rubygems'
    require 'captcha'

    var= CAPTCHA::Web.new
    p var.to_html("captcha_temp")

    so that you don't have all the Rails snick-snack to wade through.

    Also, here's a link to a discussion talking about the captcha gem
    http://groups.google.com/group/uso-dev/browse_thread/thread/63642201fb194e0d

    I think it mentions that it needs the ruby-gd gem and that that gem is
    source-only (so you need to compile yourself)

    V.-

    --
    http://www.braveworld.net/riva
     
    Vassilis Rizopoulos, May 15, 2008
    #4
  5. Ss Kk

    Axel Etzold Guest

    -------- Original-Nachricht --------
    > Datum: Thu, 15 May 2008 19:16:41 +0900
    > Von: Ss Kk <>
    > An:
    > Betreff: Re: CAPTCHA gem


    > Axel Etzold wrote:
    > > -------- Original-Nachricht --------
    > >> Datum: Thu, 15 May 2008 17:55:06 +0900
    > >> Von: Ss Kk <>
    > >> An:
    > >> Betreff: CAPTCHA gem

    > >
    > >> Application Trace | Framework Trace | Full Trace
    > >>
    > >> d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    > >> `gem_original_require'
    > >> d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
    > >> `require'
    > >>

    > >
    > > Hello,
    > >
    > > do you require rubygems in your script, ie., do you have a line
    > >
    > > require "rubygems"
    > >
    > > before
    > >
    > > require "captcha" ...
    > >
    > > in your script ?
    > > Maybe you can post some shortened bit of code ...
    > >
    > > Best regards,
    > >
    > > Axel

    >
    > Hi,
    > Thanks for your reply Butit is not making any change ,Still same
    > error
    >
    >
    > Here is code of my user controller:
    > require 'rubygems'
    > require 'captcha'//Gives error to this line
    >
    > class UserController < ApplicationController
    >
    > def register
    > var= CAPTCHA::Web.new
    > var.to_html("captcha_temp")
    > end
    > end
    >
    > And code of Captcha file: ,you will get :
    >
    > "D:\ruby\lib\ruby\gems\1.8\gems\captcha-0.1.2\lib\captcha.rb"
    > (If installed Captha gem)
    >
    >
    > Tell me what's going wrong.
    > --
    > Posted via http://www.ruby-forum.com/.


    Hello,

    there is a dependency problem. The captcha gem wants to load
    the GD library

    http://www.boutell.com/gd/

    (which is not written in Ruby).
    You'll have to install that and probably one of the Ruby bindings
    to GD.
    From a search on Rubyforge, I gather that the Ruby gem GD is now
    called ruby-gd.
    As the captcha gem you're trying to install has its last release
    on March 28, 2004 and the now-name-changed GD/ruby-gd gem releases only
    one file, from January, 30th, 2007, there might have happened some changes
    in the meantime, I'm afraid :-(

    Maybe it's good idea to contact the author of the ruby-gd gem
    to ask for help ... or use some other turing test gem, like turing.

    Best regards,

    Axel




    --
    249 Spiele für nur 1 Preis. Die GMX Spieleflatrate schon ab 9,90 Euro.
    Neu: Asterix bei den Olympischen Spielen: http://flat.games.gmx.de
     
    Axel Etzold, May 15, 2008
    #5
  6. Ss Kk

    Ss Kk Guest

    Ss Kk, May 16, 2008
    #6
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gga
    Replies:
    0
    Views:
    256
  2. han
    Replies:
    1
    Views:
    289
    Lyle Johnson
    Oct 24, 2005
  3. Ara.T.Howard
    Replies:
    0
    Views:
    329
    Ara.T.Howard
    Oct 27, 2005
  4. Clifford Heath
    Replies:
    7
    Views:
    561
    Shanti Braford
    Jun 9, 2006
  5. Michael Glaesemann

    gem query finds gem, yet require fails

    Michael Glaesemann, Nov 12, 2006, in forum: Ruby
    Replies:
    5
    Views:
    357
    Michael Glaesemann
    Nov 26, 2006
  6. Austin 7873
    Replies:
    5
    Views:
    412
    Eric Hodel
    Jan 27, 2007
  7. sur
    Replies:
    0
    Views:
    315
  8. Babysudha Na

    CAPTCHA gem

    Babysudha Na, Jul 28, 2008, in forum: Ruby
    Replies:
    0
    Views:
    239
    Babysudha Na
    Jul 28, 2008
Loading...