I've got a Rails 4.0.2 app that I'm upgrading to Rails 4.2. I've followed the migration guide exactly. I've run the migration rake task at each step and I also ran bundle / bundle update to update my dependencies. As part of the process I also had to upgrade from Ruby 2.0.0 to 2.3.0.
When I try to start my rails server I get the following output:
/Users/ACIDSTEALTH/.gem/ruby/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/key_generator.rb:2:in `require': cannot load such file -- openssl (LoadError)
from /Users/ACIDSTEALTH/.gem/ruby/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/key_generator.rb:2:in `<top (required)>'
from /Users/ACIDSTEALTH/.gem/ruby/2.3.0/gems/railties-4.2.5.1/lib/rails/application.rb:5:in `require'
from /Users/ACIDSTEALTH/.gem/ruby/2.3.0/gems/railties-4.2.5.1/lib/rails/application.rb:5:in `<top (required)>'
from /Users/ACIDSTEALTH/.gem/ruby/2.3.0/gems/railties-4.2.5.1/lib/rails.rb:11:in `require'
from /Users/ACIDSTEALTH/.gem/ruby/2.3.0/gems/railties-4.2.5.1/lib/rails.rb:11:in `<top (required)>'
from /Users/ACIDSTEALTH/.gem/ruby/2.3.0/gems/railties-4.2.5.1/lib/rails/commands/server.rb:4:in `require'
from /Users/ACIDSTEALTH/.gem/ruby/2.3.0/gems/railties-4.2.5.1/lib/rails/commands/server.rb:4:in `<top (required)>'
from /Users/ACIDSTEALTH/Dropbox/Work/firmplay/config/boot.rb:5:in `require'
from /Users/ACIDSTEALTH/Dropbox/Work/firmplay/config/boot.rb:5:in `<top (required)>'
from bin/rails:3:in `require_relative'
from bin/rails:3:in `<main>'
I've tried the following, all without any success:
- I ran
brew install openssl
. Installed openssl. No dice. - Ran
brew update
andbrew doctor
. This led me through a whole cycle of uninstalling and reinstalling brew. Got brew reinstalled along with openssl. Still no luck. Same error. - Tried downgrading the app to Ruby 2.0 again, but that raised some dependency issues in the Gemfile, so it's not an option.
Tried
gem install openssl
, which failed with:ERROR: While executing gem ... (Gem::Exception) Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
I've been banging my head on the keyboard all day on this. What limited resources I've found on this issue are all specially tailored to users who use rvm
. I tried installing rvm but that led to another slew of problems, forcing me to ultimately remove rvm and all traces of it from my system.
My setup: OS 10.11.3 Xcode (latest release) iTerm2 /w ZSH Homebrew (latest) Chruby and ruby-install for managing rubies Migrating from Rails 4.0.2 on Ruby 2.0.0 to Rails 4.2.5 on Ruby 2.3.0.
Update
I made some progress on resolving this, though I must admit I feel quite clueless about what the source of the problem was to begin with. I ran ruby-install ruby-2.3.0 — --with-openssl-dir=/usr/local
to recompile Ruby. Restarted my shell and this time I was able to reinstall openssl, but I had to do sudo gem install openssl
. From here I was finally able to launch my rails server. I'm still really confused about what happened here.