我使用了以下指南: http: //www.tweetegy.com/2012/10/setting-up-a-captcha-with-recaptcha-service-and-the-captcha-gem/
我在 development.rb 中有以下内容:
ENV['RECAPTCHA_PUBLIC_KEY'] = 'keyString'
ENV['RECAPTCHA_PRIVATE_KEY'] = 'keyString'
在 config/initializers/recaptcha.rb 中:
Recaptcha.configure do |config|
config.public_key = RECAPTCHA_PUBLIC_KEY
config.private_key = RECAPTCHA_PRIVATE_KEY
end
在开发中运行 rails server 时出现以下错误:
Exiting
/home/action/visualhaggard.org/config/initializers/recaptcha.rb:2:in `block in <top (required)>': uninitialized constant RECAPTCHA_PUBLIC_KEY (Nam
eError)
有没有人遇到并解决了这个问题?我有错字吗?谢谢。