【问题标题】:reCaptcha Gem | ERROR: Invalid domain for site key验证码宝石 |错误:站点密钥的域无效
【发布时间】:2015-06-01 14:21:20
【问题描述】:

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

reCaptcha 显示在本地主机上,但在部署到生产环境时,我只收到“错误:站点密钥的域无效”

不确定我需要在这里做什么。站点部署在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

【问题讨论】:

    标签: ruby-on-rails-4 recaptcha


    【解决方案1】:

    问题似乎是因为我的代码本身存在错误。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-08-24
      • 1970-01-01
      • 2018-05-04
      • 2016-04-25
      • 2021-09-03
      • 1970-01-01
      • 2011-04-15
      相关资源
      最近更新 更多