Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't install simple_captcha produces uninitialized constant Sprockets::Helpers

I have included the simple_captcha gem as instructed on their site:

gem 'simple_captcha', :git => 'git://github.com/galetahub/simple-captcha.git'

I have then run bundler to install it.

Finally when I go to run the following command I get an error:

 rails generate simple_captcha

.rvm/gems/ruby-1.9.3-p327@eapi4/bundler/gems/simple-captcha-e99cc7e8bf6b/lib/simple_captcha/form_builder.rb:7:in `included': uninitialized constant Sprockets::Helpers (NameError)

I've searched on the web and can't find any other users with this problem.

Any help appreciated

like image 347
chell Avatar asked Dec 20 '22 01:12

chell


1 Answers

They say in this pull request that the plugin doesn't support rails 4, You can download their branch and try it out.

Looking at the diff it shows your problem

-      base.send(:include, Sprockets::Helpers::RailsHelper)
-      base.send(:include, Sprockets::Helpers::IsolatedHelper)
+      base.send(:include, Sprockets::Rails::Helper)

https://github.com/galetahub/simple-captcha/pull/39/files

like image 176
Eran H. Avatar answered Dec 31 '22 13:12

Eran H.