title: gem install mysql ... ERROR
body: <p>To install MySQL gem:</p>
  
  <pre><code>  $ export ARCHFLAGS="-arch i386 -arch x86_64"
    $ gem install mysql -- --with-mysql-config=/usr/local/bin/mysql_config
  </code></pre>
  
  <p>returns an error:</p>
  
  <pre><code>  ERROR:  While executing gem ... (NoMethodError)
    undefined method `spec' for nil:NilClass
  </code></pre>
  
  <p>How can I fix it?</p>
  
  <p>Info:</p>
  
  <pre><code>  $ brew list
    git       
    mysql     
    readline
  
    $ gem env
    RubyGems Environment:
    - RUBYGEMS VERSION: 1.3.7
    - RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
    - INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
    - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
    - EXECUTABLE DIRECTORY: /usr/bin
    - RUBYGEMS PLATFORMS:
      - ruby
      - universal-darwin-10
    - GEM PATHS:
       - /Library/Ruby/Gems/1.8
       - /Users/horace/.gem/ruby/1.8
       - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
    - GEM CONFIGURATION:
       - :update_sources =&gt; true
       - :verbose =&gt; true
       - :benchmark =&gt; false
       - :backtrace =&gt; false
       - :bulk_threshold =&gt; 1000
       - "gem" =&gt; "--no-ri --no-rdoc"
    - REMOTE SOURCES:
       - http://rubygems.org/
  
    $ which mysql
    /usr/local/bin/mysql
  
    $ gem list
    *** LOCAL GEMS ***
    brewbygems (0.3.1)
    sqlite3-ruby (1.3.2)
  </code></pre>
  
  <p>Thanks!</p>
  
  <p>EDIT: </p>
  
  <p>Output from dtruss: <a href="http://clomputing.com/temp/dtruss-gem-install-mysql.txt" rel="nofollow">http://clomputing.com/temp/dtruss-gem-install-mysql.txt</a></p>