in `latest_partials’: undefined method `[]‘ for nil:NilClass
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 comments.
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.
Mate, I have this issue too. What do you mean by foreign folders?
Cheers
Nigel
If there are any folders or files which don’t fit the format [name]-[version] you will get that error.
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/
Leave a Reply