If you are suddenly getting in `latest_partials': undefined method `[]' for nil:NilClass error when calling some gem methods like Gem.latest_load_paths or Gem.path, check your gems folder (on a PC it’s /Ruby/lib/ruby/gems/1.8/gems). Make sure there are no foreign folders or files in there. Rubygems expects all folders to be in <name>-<version> format.
4 Responses to “in `latest_partials’: undefined method `[]’ for nil:NilClass”


June 21st, 2007 at 9:47 pm
Thanks! I’ve been struggling with this on autotest for a couple weeks now - and your the first place that gave me the correct answer.
August 30th, 2007 at 8:28 pm
Mate, I have this issue too. What do you mean by foreign folders?
Cheers
Nigel
August 30th, 2007 at 10:06 pm
If there are any folders or files which don’t fit the format [name]-[version] you will get that error.
November 20th, 2007 at 12:56 pm
Thanks! That did it. Mac users: just run Gem.path from console if you need to know your gem path. Mine was /opt/local/lib/ruby/gems/1.8/