gemのupdateがopensslのせいで通らない

以下エラーメッセージ。

$ gem update --system
ERROR:  Loading command: update (LoadError)
	dlopen(/Users/user_name/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle, 9): Symbol not found: _SSLv2_client_method
  Referenced from: /Users/user_name/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle
  Expected in: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
 in /Users/user_name/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle - /Users/user_name/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

原因はopensslの云々かんぬんとのこと。

$ brew link openssl --force

opensslのbrewリンクを貼り、rbenvのrubyを入れなおす。

$ rbenv versions
system
1.9.3-p545
* 2.1.1 (set by /Users/user_name/.rbenv/version)

rbenvのversionsで現在のバーションを確認し、

$ env CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" rbenv install -f 2.1.1


参考
homebrewでOpenSSLの脆弱性対策版を入れたのでRubyも更新させる - 別館 子子子子子子(ねこのここねこ)