<p>Here is the deal. </p>

<p>$ gem --version</p>

<blockquote>
  <p>1.1.0</p>
</blockquote>

<p>$ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config</p>

<blockquote>
  <p>Bulk updating Gem source index for:
  <a href="http://gems.rubyforge.org/" rel="nofollow noreferrer">http://gems.rubyforge.org/</a> ERROR: 
  could not find mysql locally or in a
  repository</p>
</blockquote>

<p>$ sudo gem update</p>

<blockquote>
  <p>Updating installed gems Bulk updating
  Gem source index for:
  <a href="http://gems.rubyforge.org/" rel="nofollow noreferrer">http://gems.rubyforge.org/</a> </p>
  
  <p>Updating
  RedCloth ERROR:  While executing gem
  ... (Gem::GemNotFoundException)
      could not find RedCloth locally or in a repository</p>
</blockquote>

<p>I've tried <a href="http://www.gregbenedict.com/2008/02/21/mysql-ruby-gem-install-issues-solved/" rel="nofollow noreferrer">this</a>, <a href="http://dev.mysql.com/downloads/ruby.html" rel="nofollow noreferrer">this</a>, <a href="http://installingcats.com/2007/12/13/mysql-ruby-gem-install-problem-on-mac-os-x-leopard/" rel="nofollow noreferrer">this</a>, <a href="http://www.docuverse.com/blog/donpark/2007/06/14/os-x-mysql-ruby-gem-install-problem" rel="nofollow noreferrer">this</a>, and a ton of others. </p>

<p>None of them have worked for me. Is anyone else having this problem? If so what did you do to fix it that is not mentioned above? </p>

[{'answer_id': 41160, 'author': 'Orion Edwards', 'author_id': 234, 'author_profile': 'https://Stackoverflow.com/users/234', 'pm_score': 2, 'selected': False, 'text': "<p>Step 1</p>\n\n<pre><code>gem update --system\n</code></pre>\n\n<p>It probably won't provide the fix itself, but You <em>really</em> want rubygems 1.2. It will save you about 8 days waiting as it doesn't need to do the 'Bulk updating 102304 gems' rubbish any more</p>\n\n<p>It actually looks like it can't find the mysql gem at all, let alone download or install it. You're not behind a proxy server or something weird like that?</p>\n\n<p>If it's something to do with your rubygems or the net, rather than mysql specifically, then the gem update --system should reveal it too</p>\n"}, {'answer_id': 41178, 'author': 'hoyhoy', 'author_id': 3499, 'author_profile': 'https://Stackoverflow.com/users/3499', 'pm_score': 0, 'selected': False, 'text': "<p>Do you have different ruby versions on your system?  If you're running the Darwin-supplied ruby binary, but installed ruby gems under /usr/local, then you'll get errors like this.  Even if you've aliased ruby to point to /usr/local, the gem command may fail if the proper ruby binary is not resolved correctly by your shell's $PATH.  Also, if /usr/local/bin is located physically after /usr/bin in your path, gem will use /usr/bin/ruby to load the gems from /Library/Ruby/Gems/1.8/gems/.  You may want to symlink /usr/lib/ruby/gems/1.8/gems to /Library/Ruby/Gems/1.8/gems/ to prevent this sort of thing. </p>\n"}, {'answer_id': 41182, 'author': 'mk.', 'author_id': 1797, 'author_profile': 'https://Stackoverflow.com/users/1797', 'pm_score': 3, 'selected': False, 'text': '<p>First of all as Orion Edwards said make sure you have rubygems 1.2. Unfortunately, </p>\n\n<blockquote>\n  <p>gem update --system</p>\n</blockquote>\n\n<p>did not work for me. </p>\n\n<p>Instead I had to:</p>\n\n<ol>\n<li>Manually download <a href="http://rubyforge.org/frs/download.php/38844/rubygems-update-1.2.0.gem" rel="nofollow noreferrer">rubygems-update-1.2.0</a> from rubyforge.</li>\n<li>$ sudo gem install /path/to/rubygems-update-1.2.0.gem</li>\n<li>$ update_rubygems</li>\n</ol>\n\n<p>Now that I had rubygems 1.2 I ran</p>\n\n<blockquote>\n  <p>$ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config</p>\n</blockquote>\n\n<p>Everything is working. Thanks Orion Edwards for steering me in the right direction. </p>\n'}, {'answer_id': 223708, 'author': 'James A. Rosen', 'author_id': 1190, 'author_profile': 'https://Stackoverflow.com/users/1190', 'pm_score': 0, 'selected': False, 'text': '<p>Ryan Grove has a <a href="http://wonko.com/post/how-to-install-the-mysqlruby-gem-on-mac-os-x-leopard" rel="nofollow noreferrer">blog post</a> with the answer:</p>\n\n<pre><code>sudo env ARCHFLAGS="-arch i386" gem install mysql -- \\\n  --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib \\\n  --with-mysql-include=/usr/local/mysql/include\n</code></pre>\n'}, {'answer_id': 1120966, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>Installing XCode solved this problem for me.</p>\n\n<p>This is because it includes the make and gcc tools, which are required by the gem.</p>\n'}]
['https://Stackoverflow.com/questions/41134', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1797/']