ambethia / recaptcha

ReCaptcha helpers for ruby apps

Home Page:http://github.com/ambethia/recaptcha

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ActionView::Template::Error: undefined local variable or method `recaptcha_tags' for #<#<Class:0x000055bd2eb3da08>:0x000055bd2f577618>

veekram opened this issue · comments

I am using the following gems and versions and trying to make recaptcha working.

ruby '2.6.8'
# Rails
# https://github.com/rails/rails
gem 'rails', '~> 4.2.11'
# Support CAPTCHA
# https://github.com/ambethia/recaptcha
gem 'recaptcha', require: 'recaptcha/rails'  ( version 5.8.1 )

It works fine on local machine without any issues. But when I deploy the same code to production environment, it throws with me an error

ActionView::Template::Error: undefined local variable or method `recaptcha_tags' for #<#<Class:0x000055bd2eb3da08>:0x000055bd2f577618>

I have been using <%= repactcha_tags %> in rails view. And it's complaining undefined method for recaptcha_tags in views.

Appreciate your help. Thank you.

I'd assume this has to do with the gem not being loaded in production somehow.
Check were the gem is required in development and maybe that's different in production. Might also be able to reproduce by setting RAILS_ENV=production locally.

Closing since rails 2.4 is not something I want to support + this is most likely a local require bug.