Okay, I'm having the same problem again when trying to install the 
postgresql gem:
$ gem install postgres
Attempting local installation of 'postgres'
Local gem file not found: postgres*.gem
Attempting remote installation of 'postgres'
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied - /usr/lib/ruby/gems/1.8/cache/postgres-0.7.1.gem
$ sudo gem install postgres
Password:
Attempting local installation of 'postgres'
Local gem file not found: postgres*.gem
Attempting remote installation of 'postgres'
Building native extensions.  This could take a while...
can't find header files for ruby.
ERROR:  While executing gem ... (RuntimeError)
    ERROR: Failed to build gem native extension.
Gem files will remain installed in 
/usr/lib/ruby/gems/1.8/gems/postgres-0.7.1 for inspection.
  ruby extconf.rb install postgres\n

What do I do?

-- 
Posted via http://www.ruby-forum.com/.