突然 rails s しようとして warning: already initialized constant APP_PATH と言われるようになった

セキュリティFIXのOSXアップデートをかけた後の話。

OpenSSLにまた重度の欠陥、修正アップデートは3月19日にリリース:CodeZine

これの対策かな?OpenSSL辺りでなにか死んでるっぽかったので、 Rubyを再インストールして解決。

nyangry:app(27m|implement_hoge_page) $ rails s                                        [ruby-2.1.5p273(L)]
./bin/rails:6: warning: already initialized constant APP_PATH
/Users/masuyama/workspace/app/bin/rails:6: warning: previous definition of APP_PATH was here
Usage: rails COMMAND [ARGS]


nyangry:app(27m|implement_hoge_page) $ rake rails:update:bin                          [ruby-2.1.5p273(L)]
/Users/nyangry/.rbenv/versions/2.1.5/lib/ruby/2.1.0/openssl.rb:17:in `require': dlopen(/Users/nyangry/.rbenv/versions/2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/openssl.bundle, 9): Symbol not found: _SSLv2_client_method
  Referenced from: /Users/nyangry/.rbenv/versions/2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/openssl.bundle
  Expected in: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
 in /Users/nyangry/.rbenv/versions/2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/openssl.bundle - /Users/nyangry/.rbenv/versions/2.1.5/lib/ruby/2.1.0/x86_64-darwin14.0/openssl.bundle (LoadError)
        from /Users/nyangry/.rbenv/versions/2.1.5/lib/ruby/2.1.0/openssl.rb:17:in `<top (required)>'
        from /Users/nyangry/workspace/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.9/lib/active_support/key_generator.rb:2:in `require'
        from /Users/nyangry/workspace/app/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.9/lib/active_support/key_generator.rb:2:in `<top (required)>'
        from /Users/nyangry/workspace/app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.9/lib/rails/application.rb:4:in `require'
        from /Users/nyangry/workspace/app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.9/lib/rails/application.rb:4:in `<top (required)>'
        from /Users/nyangry/workspace/app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.9/lib/rails.rb:11:in `require'
        from /Users/nyangry/workspace/app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.9/lib/rails.rb:11:in `<top (required)>'
        from /Users/nyangry/workspace/app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.9/lib/rails/all.rb:1:in `require'
        from /Users/nyangry/workspace/app/vendor/bundle/ruby/2.1.0/gems/railties-4.1.9/lib/rails/all.rb:1:in `<top (required)>'
        from /Users/nyangry/workspace/app/config/application.rb:3:in `require'
        from /Users/nyangry/workspace/app/config/application.rb:3:in `<top (required)>'
        from /Users/nyangry/workspace/app/vendor/bundle/ruby/2.1.0/gems/spring-1.3.1/lib/spring/application.rb:82:in `require'
        from /Users/nyangry/workspace/app/vendor/bundle/ruby/2.1.0/gems/spring-1.3.1/lib/spring/application.rb:82:in `preload'
        from /Users/nyangry/workspace/app/vendor/bundle/ruby/2.1.0/gems/spring-1.3.1/lib/spring/application.rb:143:in `serve'
        from /Users/nyangry/workspace/app/vendor/bundle/ruby/2.1.0/gems/spring-1.3.1/lib/spring/application.rb:131:in `block in run'
        from /Users/nyangry/workspace/app/vendor/bundle/ruby/2.1.0/gems/spring-1.3.1/lib/spring/application.rb:125:in `loop'
        from /Users/nyangry/workspace/app/vendor/bundle/ruby/2.1.0/gems/spring-1.3.1/lib/spring/application.rb:125:in `run'
        from /Users/nyangry/workspace/app/vendor/bundle/ruby/2.1.0/gems/spring-1.3.1/lib/spring/application/boot.rb:18:in `<top (required)>'
        from /Users/nyangry/.rbenv/versions/2.1.5/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /Users/nyangry/.rbenv/versions/2.1.5/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from -e:1:in `<main>'
$ rbenv versions
$ rbenv uninstall 2.1.5
$ rbenv install 2.1.5
$ rbenv global 2.1.5
$ rbenv rehash
$ gem install bundler
$ gem install refe2