Ruby on rails gem recaptcha,错误-站点密钥无效

Ruby on rails gem recaptcha,错误-站点密钥无效,ruby-on-rails,recaptcha,Ruby On Rails,Recaptcha,我在本地主机上运行项目:3666 以用户注册的形式重新获取TCHA显示无效站点密钥 我使用rails 3.2.22,gem-recaptchav。0.4.0 请看下面我的文件 development.rb: ActiveRecord::Base.logger = Logger.new(STDOUT) if defined?(Rails::Console) Bdsmgalaxy::Application.configure do # Settings specified here will

我在本地主机上运行项目:3666

以用户注册的形式重新获取TCHA显示无效站点密钥

我使用rails 3.2.22,gem-recaptchav。0.4.0

请看下面我的文件

development.rb:

ActiveRecord::Base.logger = Logger.new(STDOUT) if defined?(Rails::Console)

Bdsmgalaxy::Application.configure do
  # Settings specified here will take precedence over those in config/application.rb

  # In the development environment your application's code is reloaded on
  # every request.  This slows down response time but is perfect for development
  # since you don't have to restart the webserver when you make code changes.
  config.cache_classes = false
  config.cache_store = :redis_store, 'redis://127.0.0.1:6379/2/bdsmgalaxy_development'

  # Log error messages when you accidentally call methods on nil.
  config.whiny_nils = true

  # Show full error reports and disable caching
  config.consider_all_requests_local       = true
  # config.action_controller.perform_caching = false
  config.action_controller.perform_caching = true

  # Don't care if the mailer can't send
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
  config.action_mailer.raise_delivery_errors = true

  # Print deprecation notices to the Rails logger
  config.active_support.deprecation = :log

  # Only use best-standards-support built into browsers
  config.action_dispatch.best_standards_support = :builtin

  # Do not compress assets
  config.assets.compress = false

  # Expands the lines which load the assets
  config.assets.debug = true

  # config.action_controller.asset_host = ""

 ENV['RECAPTCHA_PUBLIC_KEY'] = 'c6BAAAAAAAAChqRbQZcn_yyyyyyyyyyyyyyyyy'
 ENV['RECAPTCHA_PRIVATE_KEY'] = '6Lc6BAAAAAAAAKN3DRm6VA_xxxxxxxxxxxxxxxxx'

end

Rack::MiniProfiler.config.position = 'right'
recaptcha.rb

require 'net/http'


Recaptcha.configure do |config|

  config.public_key  = ENV['RECAPTCHA_PUBLIC_KEY']
  config.private_key = ENV['RECAPTCHA_PRIVATE_KEY']
  # Uncomment the following line if you are using a proxy server:
   #config.proxy = 'http://localhost:3666'
  # Uncomment if you want to use the newer version of the API,
  # only works for versions >= 0.3.7:
   #config.api_version = 'v2'
end

请告诉我,我是如何解决这个问题的。我的设置recaptcha gem有什么问题?

对于localhost,请在google.com/recaptcha/admin列表中注册标签:“本地”域“localhost”所有者“您的电子邮件”,并获取您的站点密钥和secretkey

config/recaptca.rb

Recaptcha.configure do |config|

config.public_key = '6LcauA8TAAAAAGncDdV2pjc8lxWHf7oSiMz9_0OS' << your site key
config.private_key = '6LcauA8TAAAAAJi52ztlkgdTQl9rSO8Y_haSONzO' << your secret key
end
Recaptcha.configure do | config|

config.public_key='6lcaua8taaaagncddv2pjc8lxwhf7osimz9_0OS'对于本地主机,请在google.com/recaptcha/admin列表中使用标签注册:“本地”域“本地主机”所有者“您的电子邮件”,并获取您的站点密钥和secretkey

config/recaptca.rb

Recaptcha.configure do |config|

config.public_key = '6LcauA8TAAAAAGncDdV2pjc8lxWHf7oSiMz9_0OS' << your site key
config.private_key = '6LcauA8TAAAAAJi52ztlkgdTQl9rSO8Y_haSONzO' << your secret key
end
Recaptcha.configure do | config|

config.public_key='6lcaua8taaaagncddv2pjc8lxwhf7osimz9_0OS'您尚未设置实际的recaptcha公钥和私钥,您正在使用gem github repo中的示例。谢谢!!!我已经建立了谷歌,现在一切正常。您还没有设置实际的recaptcha公钥和私钥,您正在使用gem github repo中的示例。谢谢!!!我已经建立了谷歌,现在一切正常。