reCaptcha宝石|错误:站点密钥的域无效

时间:2015-03-28 06:47:23

标签: ruby-on-rails-4 recaptcha

我试图将reCaptcha gem用于网站,并已遵循所有建议来构建验证码。

reCaptcha显示在localhost上但是当部署到生产时我只得到“ERROR:站点密钥的域名无效”

不确定我需要在这做什么。网站部署在http://bit.ly/1EajuIk

我使用的Gem版本是recaptcha(0.3.6),配置文件是:

Recaptcha.configure do |config|
  config.public_key = '6Lc6BAAAAAAAAChqRbQZcn_yyyyyyyyyyyyyyyyy'
  config.private_key = '6Lc6BAAAAAAAAKN3DRm6VA_xxxxxxxxxxxxxxxxx'
  # Uncomment the following line if you are using a proxy server:
  # config.proxy = 'http://myproxy.com.au:8080'
  # Uncomment if you want to use the newer version of the API,
  # only works for versions >= 0.3.7:
  # config.api_version = 'v2'
end

1 个答案:

答案 0 :(得分:1)

问题似乎是因为我的代码本身出错了。

我们在调用验证码的视图中硬编码了不正确的值。并且它没有使用配置值,从而导致错误。

相关问题