If you try to execute gem list or similar from a directory that doesn’t exist you may have seen the following error:
No such file or directory - getcwd
This happens if you delete your current directory, maybe you were in a gem directory and uninstalled that gem for example.
So maybe you should try issuing the following command on the terminal:
$ cd ~
and then
$ gem update