I have done the following steps:
Added to gemfile:
gem "recaptcha"
Added to config/initializers/recaptcha.rb
Recaptcha.configure do |config|
config.public_key = 'MyKeyHere'
config.private_key = 'MyKeyHere'
end
Added to view:
= raw recaptcha_tags
Ran: bundle install
...then restarted server. The result?
undefined local variable or method `recaptcha_tags' for #<#<Class:0x1053baaa0>:0x1053b69c8>
The gem's README says to, in Rails 2 (yes, I know you're in 3—just a minute :D), include the following line to require the gem:
config.gem "recaptcha", :lib => "recaptcha/rails"
The important bit to note here is the instruction that Rails should essentially end up running require 'recaptcha/rails'
. Your current Gemfile doesn't have that specified, so it may very well only be loading in the gem's core classes, not the Rails-specific tie-ins.
Try:
gem 'recaptcha', :require => 'recaptcha/rails'
Add the following gem into your gemfile.
gem 'recaptcha', :require => 'recaptcha/rails'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With