title: LoadError: dlopen(digest/sha1.bundle): Symbol not found: _rb_Digest_SHA1_Finish
body: <p><strong>Ruby stopped working on my brother's machine recently.</strong></p>
  
  <ul>
  <li><code>gem</code> commands</li>
  <li><code>rails server</code></li>
  <li><code>rails console</code></li>
  </ul>
  
  <p>All failed with the following error:</p>
  
  <pre><code>$ irb
  irb(main):001:0&gt; require 'digest/sha1'
  
  LoadError: dlopen(~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/x86_64-darwin12.2.0/digest/sha1.bundle, 9): Symbol not found: _rb_Digest_SHA1_Finish
    Referenced from: ~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/x86_64-darwin12.2.0/digest/sha1.bundle
    Expected in: flat namespace
  
   in ~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/x86_64-darwin12.2.0/digest/sha1.bundle - ~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/x86_64-darwin12.2.0/digest/sha1.bundle
      from ~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
      from ~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
      from (irb):1
      from ~/.rbenv/versions/2.0.0-p0/bin/irb:12:in `&lt;main&gt;'
  </code></pre>
  
  <p><em>He tried different versions of Ruby. Reinstalling everything with <code>rvm</code>. Running <code>rvm implode</code> and reinstalling <code>rvm</code>. Switching to <code>rbenv</code>. Several Rubies installed via <code>ruby-build</code>. <code>brew install ruby</code>.</em></p>
  
  <p><em>All had the same problem.</em></p>
  
  <p><em>If he uninstalled all rubies, the OS supplied version in <code>/usr/bin/ruby</code> worked. But it's 1.8.7.</em></p>
  
  <p><em>After hours of troubleshooting, we arrived at the solution below. I hope it helps you avoid some pain.</em></p>