You really should be using a Ruby version manager.
Using one properly would prevent and can resolve your permission problem when executing a `gem update` command.
I recommend *rbenv*.
However, even when you use a Ruby version manager, you may still get that same error message.
If you do, and you are using rbenv, just verify that the `~/.rbenv/shims` directory is before the path for the system Ruby.
`$ echo $PATH` will show you the order of your load path.
If you find that your shims directory comes after your system Ruby bin directory, then edit your `~/.bashrc` file and put this as your last export PATH command: `export PATH=$HOME/.rbenv/shims:$PATH`
`$ ruby -v` shows you what version of Ruby you are using
This shows that I'm currently using the system version of Ruby (usually not good)
$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
`$ rbenv global 1.9.3-p448` switches me to a newer, pre-installed version (see references below).
This shows that I'm using a newer version of Ruby (that likely won't cause the Gem::FilePermissionError)
$ ruby -v
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.4.0]
You typically should not need to preface a gem command with sudo. If you feel the need to do so, something is probably misconfigured.
For details about rbenv see the following:
*
[To see links please register here]
*
[To see links please register here]