Have You seen something like this:
NameError (undefined local variable or method `acts_as_taggable' for Route:Class):
after You have upgraded to rubygems-0.9.2? Well I saw and did a little investigation. The results:
With new rubygems require_gem is replaced with gem command. One of the differences is that with gem autorequire feature is no longer enabled. In other words gem prepares LOAD_PATH with directory with gems code, but does not include gems code automagically. So with gem command including acts_as_taggable should look like this:
gem 'acts_as_taggable' require 'taggable'
As You can see we need to specify directly file with gem code (but we don’t have know what path is needed). The question is what we need to include. Well, this information we can get from gem itself, using shell gem command (following block is shell CLI not Ruby code):
[viciu@bsd ~]$ gem spec acts_as_taggable| grep autoreq autorequire: taggable
This way we know what we have to include to run gem.
Leave a Reply