<p>I am trying to set myself up on a mac to learn Ruby on Rails, however I seem to be having some problems. If I try to run commands such as ./script/server, i get this: </p>

<blockquote>
  <p>Rails requires RubyGems >= 0.9.4 (you have 0.9.2). Please <code>gem update --system</code> and try again.</p>
</blockquote>

<p>When I run "gem update.." I get this:</p>

<blockquote>
  <p>Updating RubyGems...
  Attempting remote update of rubygems-update
  ERROR:  While executing gem ... (Errno::EACCES)
      Permission denied - /opt/local/lib/ruby/gems/1.8/cache/rubygems-update-1.3.0.gem</p>
</blockquote>

got it.
sudo gem update --system