我有紅寶石1.9.2和rails 3.1。我試圖讓註釋2.4.0工作,但我得到了nomethod錯誤。我試過卸載並重新安裝,但沒有幫助。跳轉後請看看線軸。有關如何繼續的任何建議將有所幫助。註釋給Nomethod錯誤
~/myapps/testapp/app>sudo gem install annotate
Fetching: annotate-2.4.0.gem (100%)
Successfully installed annotate-2.4.0
1 gem installed
~/myapps/testapp/app>bundle exec annotate -e -p before
/Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/annotate-2.4.0/bin/annotate:61:in block (2 levels) in <top (required)>': undefined methodeach' for nil:NilClass (NoMethodError)
from /Users/mymachine/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1308:in call'
from /Users/mymachine/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1308:inblock in parse_in_order'
from /Users/mymachine/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1264:in catch'
from /Users/mymachine/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1264:inparse_in_order'
from /Users/mymachine/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1258:in order!'
from /Users/mymachine/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1349:inpermute!'
from /Users/mymachine/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1370:in parse!'
from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/gems/annotate-2.4.0/bin/annotate:8:in'
from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/bin/annotate:19:in load'
from /Users/mymachine/.rvm/gems/ruby-1.9.2-p290/bin/annotate:19:in'
檢查這一項: 的http://計算器.com/questions/7295505/annotate-gem-and-rails-3-1 – mask8 2011-12-17 17:05:40
謝謝你解決了這個問題!如果您將其添加爲答案,我可以接受並將其關閉。 – Tabrez 2011-12-17 20:25:45