Error loading RubyGems plugin ,openssl.bundle (LoadError)
Asked Answered
A

6

47

I am new to ruby. When I type any thing related to gem, error below will happen. why causes it and how to solve the problem? Thanks!

Error loading RubyGems plugin "/Users/chiang/.rvm/gems/ruby-2.0.0-p247@global/gems/rubygems-bundler-1.2.2/lib/rubygems_plugin.rb": dlopen(/Users/chiang/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.3.0/openssl.bundle, 9): Library not loaded: /opt/local/lib/libssl.1.0.0.dylib
  Referenced from: /Users/chiang/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.3.0/openssl.bundle
  Reason: image not found - /Users/chiang/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin12.3.0/openssl.bundle (LoadError)
Apace answered 20/11, 2013 at 9:55 Comment(1)
"type any thing related to gem" what are you trying to doTransition
T
55

Things to verify...

  • How did you install rvm
  • hit rvm notes and check if it's installed properly
  • ruby -v, check for the version of ruby present

If you find any issues here, uninstall rvm using rvm implode and also remove ruby. Refer to the rvm installation guide for the use of this command.

\curl -L https://get.rvm.io | bash -s stable --ruby

OR you can try the other way without removing the present rvm installation.

rvm get stable
rvm reinstall 2.0.0

Hope this helps.

Transition answered 20/11, 2013 at 12:20 Comment(5)
I follow the official guide to install the rvm. rvm version is 1.24.1 (stable), ruby version is ruby 2.0.0p247. I have tried to reinstall ruby but it does't work.Apace
what is the o/p of $ rvm listTransition
I implode rvm and reinstall ruby again, it works! Thank U for your help!Apace
For Debian and Ubuntu this is the only way I've found to solve the error. Thanks a lotPour
rvm reinstall ruby just worked for me in my case. Rails project was working fine before on the same machine. But for some reason it started complaining about this issue.Numskull
G
45

The following worked for me.

brew rm openssl
brew cleanup openssl
brew install openssl
rvm reinstall ruby

Apparently brew update or brew upgrade breaks the Ruby runtime which is what caused the error for me.

Grandiose answered 7/1, 2015 at 15:13 Comment(1)
The other answer did not help, but this did.Accepter
D
16

To whoever having this problem with rbenv, I solved it reinstalling openssl and upgrading rbenv, then reinstalling ruby:

brew reinstall openssl
brew upgrade ruby-build rbenv
rbenv install 2.2.10 # or whatever version you're using it
Digraph answered 21/11, 2019 at 23:47 Comment(1)
I solved it by reinstalling ruby too. rbenv uninstall <version> and then rbenv install <version>Counterfactual
A
0

Im assuming you already installed the right package aka brew install/reinstall openssl if not - do it.

Another Solution (In case your package is installed) - Might be that your package is not referenced to the right endpoint version, you have multiple versions of the same package (on this use-case openssl package) and your rvm is not finding it event though it's installed.

Run list of the package versions and switch to the right one.

example:

brew list  --versions openssl

/* Output:
openssl 1.0.2s
openssl 1.2
openssl 1.3
*/

brew switch openssl 1.0.2s
Agentive answered 28/6, 2020 at 10:10 Comment(0)
L
0

Landed on this post in August '21 on Mojave using rbenv with this error:

Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (LoadError)
Reason: image not found - /.rbenv/versions/2.5.1/lib/ruby/2.5.0/x86_64-darwin17/digest/md5.bundle

Found an answer that worked for me on this post

brew install rbenv/tap/[email protected]
ln -sfn /usr/local/Cellar/[email protected]/1.0.2t /usr/local/opt/openssl

(first command finished in ~5 minutes)

Coming from this GitHub Issue

Lewellen answered 19/8, 2021 at 22:11 Comment(1)
Thank you, worked for me Dec '21 with Catalina.Endodontics
K
0

I had the same error.

Downgrading libssl-dev helped to me:

sudo apt install libssl-dev=1.1.1l-1ubuntu1.4

Found here

Kiosk answered 12/9, 2023 at 9:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.