captcha + osx

2 views
Skip to first unread message

anotherjesse

unread,
Feb 22, 2007, 4:27:14 PM2/22/07
to userscripts.org development
We (Britt specifically) added captchas to our user signup process.

Cool!

Two issues though

1) setting up the captcha gem on osx is hard (not sure of the full
issue)
2) the captcha can be hard to read

The first issue makes passing unit tests tough on osx --- either we
can document how to make the captcha gem work or perhaps a mock
captcha gem that has the same interface but doesn't really create
images.

The second issue is probably just settings...

Lets fix these issues.

Jesse

Gareth Andrew

unread,
Feb 23, 2007, 9:41:18 AM2/23/07
to uso...@googlegroups.com
Setting up captcha is also complex on windows. I had two problems
getting it to work on my setup.

The first is captcha requires GD (gem: ruby-gd i think) which is only
distributed as a source gem and requires compilation. Copying the
precompiled GD library from
http://tools.assembla.com/breakout/wiki/0.6-ReleaseConfiguration to
ruby\lib\ruby\site_ruby\1.8\i386-msvcrt\ solved the problem for me.
**
The second is that in the us.o source, the captcha configuration doesn't
work properly. In users_controller.rb and users_controller_test.rb the
captch font is specified as
@w = CAPTCHA::Web.new(:font => RAILS_ROOT + "/vendor/serif.ttf", ...
On windows captcha tries to load the font file
"/usr/share/fonts/truetype/{RAILS_ROOT}/vendor/serif.ttf.ttf". On my
source tree I have changed the font option to simply "serif" e.g.
@w = CAPTCHA::Web.new(:font => "serif", ...
and created the file c:/usr/share/fonts/truetype/serif.ttf which gets
things working for me.

Perhaps the captcha font location should be coded in environment.rb, to
make it easier to override?

Gareth.

Reply all
Reply to author
Forward
0 new messages