Podfile

If you run into a library error

LoadError - library not found for class Digest::MD5 -- digest/md5

One way to solve this error is to uninstall cocoapods and install using brew:

sudo gem uninstall cocoapods
rbenv rehash

Then:

brew install cocoapods

Error

Full error:

LoadError - library not found for class Digest::MD5 -- digest/md5
~/.rbenv/versions/2.3.1/lib/ruby/2.3.0/digest.rb:16:in `const_missing'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.6.0.beta.1/lib/cocoapods-core/source/metadata.rb:45:in `path_fragment'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.6.0.beta.1/lib/cocoapods-core/source.rb:111:in `pod_path'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.6.0.beta.1/lib/cocoapods-core/source.rb:267:in `search'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.6.0.beta.1/lib/cocoapods-core/source/aggregate.rb:83:in `block in search'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.6.0.beta.1/lib/cocoapods-core/source/aggregate.rb:83:in `select'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.6.0.beta.1/lib/cocoapods-core/source/aggregate.rb:83:in `search'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/resolver.rb:423:in `create_set_from_sources'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/resolver.rb:393:in `find_cached_set'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/resolver.rb:367:in `specifications_for_dependency'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/resolver.rb:174:in `search_for'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/resolver.rb:283:in `block in sort_dependencies'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/resolver.rb:276:in `each'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/resolver.rb:276:in `sort_by'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/resolver.rb:276:in `sort_dependencies'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:53:in `block in sort_dependencies'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:70:in `with_no_such_dependency_error_handling'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:52:in `sort_dependencies'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:288:in `initial_state'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:210:in `start_resolution'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:168:in `resolve'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/resolver.rb:123:in `resolve'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/installer/analyzer.rb:896:in `block in resolve_dependencies'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/user_interface.rb:64:in `section'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/installer/analyzer.rb:894:in `resolve_dependencies'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/installer/analyzer.rb:106:in `analyze'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/installer.rb:250:in `analyze'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/installer.rb:160:in `block in resolve_dependencies'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/user_interface.rb:64:in `section'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/installer.rb:159:in `resolve_dependencies'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/installer.rb:122:in `install!'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/command/install.rb:48:in `run'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/command.rb:52:in `run'
~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/cocoapods-1.6.0.beta.1/bin/pod:55:in `<top (required)>'
~/.rbenv/versions/2.3.1/bin/pod:23:in `load'
~/.rbenv/versions/2.3.1/bin/pod:23:in `<main>'