2011-03-17 97 views
0

這是一個時髦的驗證碼,它提出問題而不是顯示圖片。你可以在textcaptcha.com閱讀。無論如何。我想用Ruby on Rails。一位名叫Matt Hutchinson的開發者寫了一個Gem,可以輕鬆連接到API。他有一個set of instructions next to his source files on github。無論如何,它看起來很簡單,但在試圖實現它每次我得到這個錯誤:在Ruby On Rails中使用Gems:未定義的方法?

undefined method `acts_as_textcaptcha' for #<Class:0x104098508> 
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,然後將它捆綁到我的rails應用程序中,它應該是可訪問的(據我瞭解)。我看到gemfile.rbgemfile.lock中的寶石參考,但它一次又一次地告訴我,我正在使用和未定義的方法。

寶石應該爲我定義的方法,如果不是?或者有什麼我手動必須做的?

只是讓我知道是否有任何其他信息將是有益的,謝謝!

+1

即使在'development'環境中,對於這些更改,您需要重新啓動服務器。這可能是其中之一? – sarnold 2011-03-17 23:47:53

回答

1

好吧,jeez。現在正在工作。這可能是我重新啓動服務器,但我不積極。我所做的是安裝了RubyMine,看看我是否可以使用它的調試器,這樣做需要我通過那裏運行軟件包安裝(它選擇了一些不同版本的依賴),並停止另一臺webrick服務器,運行一個通過RubyMine控制檯。我這樣做,它給了我錯誤,當我回到我的另一個安裝程序,它的工作!? 不管怎麼說,我有我的問題解決了,但在事件的人看起來這件事,這是我目前的寶石:

$ 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

+0

我真的認爲只需重新啓動我的本地服務器就是我必須做的。我對安裝寶石不是很熟悉。那麼,希望這可以很好地提醒忘記的其他人。 :) – counterbeing 2011-03-21 01:46:07

相關問題