3

I'm trying to create a new Rails project using the railstutorial.org. However, when I try to create a new app, I get the following error:

User-MacBook-Air:rails_projects user$ rails new first_ap
/user.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': dlopen(/user.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/x86_64-darwin12.5.0/digest/md5.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (LoadError)
  Referenced from: /user.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/x86_64-darwin12.5.0/digest/md5.bundle
  Reason: image not found - /user.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/x86_64-darwin12.5.0/digest/md5.bundle
    from /user.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /user.rvm/gems/ruby-1.9.3-p448@rails3tutorial2ndEd/gems/railties-3.2.14/lib/rails/generators/app_base.rb:1:in `<top (required)>'
    from /user.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /user.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /user.rvm/gems/ruby-1.9.3-p448@rails3tutorial2ndEd/gems/railties-3.2.14/lib/rails/generators/rails/app/app_generator.rb:1:in `<top (required)>'
    from /user.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /user.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /user.rvm/gems/ruby-1.9.3-p448@rails3tutorial2ndEd/gems/railties-3.2.14/lib/rails/commands/application.rb:24:in `<top (required)>'
    from /user.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /user.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /user.rvm/gems/ruby-1.9.3-p448@rails3tutorial2ndEd/gems/railties-3.2.14/lib/rails/cli.rb:15:in `<top (required)>'
    from /user.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /user.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /user.rvm/gems/ruby-1.9.3-p448@rails3tutorial2ndEd/gems/railties-3.2.14/bin/rails:7:in `<top (required)>'
    from /user.rvm/gems/ruby-1.9.3-p448@rails3tutorial2ndEd/bin/rails:23:in `load'
    from /user.rvm/gems/ruby-1.9.3-p448@rails3tutorial2ndEd/bin/rails:23:in `<main>'

How do I get rid of this OpenSSL error? I am using the following:

Rails 3.2.14
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.5.0]

rvm 1.22.11 (stable) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
1
  • add results of: file /user.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/x86_64-darwin12.5.0/digest/md5.bundle /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib and files /user.rvm/src/ruby-1.9.3-p194/ext/digest/md5/mkmf.log + /user.rvm/src/ruby-1.9.3-p194/ext/openssl/mkmf.log Commented Sep 25, 2013 at 4:15

2 Answers 2

7

Well, there's a very large chance it was overkill but for me uninstalling ruby entirely and then reinstalling it and all the gems that my project uses solved the problem.

If you're using rbenv, the commands that I used were
rbenv uninstall 2.6.3
rbenv install 2.6.3
gem install bundler
gem install rails -v 6.0.2
rbenv rehash
bundle update

Again, this is probably overkill, but it solved the problem after brew install openssl didn't work for me.

Sign up to request clarification or add additional context in comments.

Comments

2

If you haven't installed OpenSSL, try installing it with Homebrew

brew install openssl

4 Comments

When I try that I get the output: Warning: openssl-1.0.1e already installed I'm confused as to how rails can't find openssl when I create a new app.
Try brew reinstall openssl and then, uninstall rvm: rvm implode; and reinstall rvm. Although, you might dig on Chruby as it's wayyyy simpler for development.
this version of rvm made sure openssl is installed and ruby was compiled using it, switching to other tool will not make it working magically, there was either a conflict during compilation or something changed after ruby was compiled.
Any number of things might have happened, from rvm being difficult, to a botched homebrew installation, to your environment having both a homebrew and a macports or other OpenSSL install hanging around. Re-installing both OpenSSL and Ruby should help :) Did that resolve your problem? If so, could you select an answer?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.