在Ruby On Rails中使用Gems:未定义的方法?

有这个时髦的validation码,询问问题而不是显示图片。 您可以在textcaptcha.com上阅读相关内容。 无论如何。 我想在Ruby on Rails中使用它。 一位名叫Matt Hutchinson的开发人员写了一个Gem,可以轻松连接到API。 他在github上的源文件旁边有一组指令 。 无论如何,它看起来很简单,但在尝试实现它时,我每次都会收到此错误:

undefined method `acts_as_textcaptcha' for # Rails.root: /Users/cory/Documents/Learning/RoR/dpt Application Trace | Framework Trace | Full Trace app/models/citation.rb:20 app/controllers/citations_controller.rb:29:in `new' 

我的问题的根源与这个特定的gem有点关系,而且更多关于gem如何工作。 我已经安装了gem,然后将它捆绑在我的rails应用程序中,它应该是可访问的(据我所知)。 我在gemfile.rbgemfile.lock看到对gem的引用,但是它一次又一次告诉我我正在使用和未定义的方法。

如果不是,gem应该为我定义方法? 或者我手动必须做什么?

如果有任何其他信息有用,请告诉我,谢谢!

好吧,jeez。 它现在正在运作。 可能是我重新启动了服务器,但我并不积极。 我所做的是安装RubyMine以查看我是否可以使用它的调试器,这样做需要我运行bundle install(它选择了一些不同版本的某些依赖项),并且还停止我的其他webrick服务器,运行一个通过RubyMine控制台。 我这样做了,它给了我错误,当我回到我的其他安装程序时它工作了!? 无论如何,我已经解决了我的问题,但如果有人看到这个,这些是我目前的gem:

 $ bundle install Using rake (0.8.7) Using abstract (1.0.0) Using activesupport (3.0.0) Using builder (2.1.2) Using i18n (0.4.2) Using activemodel (3.0.0) Using erubis (2.6.6) Using rack (1.2.1) Using rack-mount (0.6.13) Using rack-test (0.5.7) Using tzinfo (0.3.24) Using actionpack (3.0.0) Using mime-types (1.16) Using polyglot (0.3.1) Using treetop (1.4.9) Using mail (2.2.15) Using actionmailer (3.0.0) Using arel (1.0.1) Using activerecord (3.0.0) Using activeresource (3.0.0) Using bcrypt-ruby (2.1.4) Using acts_as_textcaptcha (2.2.0) Using bundler (1.0.10) Using thor (0.14.6) Using railties (3.0.0) Using rails (3.0.0) Using sqlite3-ruby (1.2.5) Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. 

谢谢大家! 但是如果您正在尝试这样做,请尝试按照建议首先重新启动服务器,我希望我知道这是否有效:D