I just discovered I can no longer gem push … any more and some digging led me to a need to update my RVM SSL certs.
I ran rvm osx-ssl-certs status all but that gave me:
/Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': dlopen(/Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/x86_64-darwin12.4.0/openssl.bundle, 9): Library not loaded: /opt/local/lib/libssl.1.0.0.dylib (LoadError)
Referenced from: /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/x86_64-darwin12.4.0/openssl.bundle
Reason: image not found - /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/x86_64-darwin12.4.0/openssl.bundle
from /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/openssl.rb:17:in `<top (required)>'
from /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
Certificates for /usr/local/etc/openssl/cert.pem: Up to date.
Certificates for : Old.
Certificates for /etc/openssl/cert.pem: Up to date.
rvm -v shows I am running the latest RVM (as of today)
rvm 1.22.15 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
Oddly I am not sure why it's referring to ruby-2.0.0-p195 however as rvm list gives
rvm rubies
ruby-1.9.3-p392 [ x86_64 ]
ruby-2.0.0-p195 [ x86_64 ]
=* ruby-2.0.0-p247 [ x86_64 ]
Any ideas how to fix this?
Uninstalling openssl and re-installing it worked for me.
brew remove openssl
and then
brew install openssl
Your questions mentions three paths /opt/local, /usr/local and /etc/openssl they belong to Macports, Homebrew and SM Framework respectively.
As the last one is used to build static rubies it is harmeless and not related to the problem. The other two suggest that you have switched from macports to homebrew between installing the rubies.
You need to reinstall ruby-2.0.0-p195 which is referring still the old paths from macports, you can do it with:
rvm reinstall ruby-2.0.0-p195
You can get more details about the rubies and openssl paths they use running:
rvm --debug osx-ssl-certs update all
Trying to run 'bundle' I also started getting the openssl dylib complaint, though a slightly different path.
I tried most of these, and a few other things. I had rvm, and some broken remnants of a fink install, though I'd tried to replace it with brew a while back.
Many times I was getting
Library not loaded: /sw/lib/libssl.1.0.0.dylib
However trying to re-install openssl with brew always produced
sudo brew link openssl
Warning: openssl is keg-only and must be linked with --force
Note that doing so can interfere with building software.
or
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
So it was pretty confusing what I should do. What seemed to help in the end, after much trial, included:
$ rm /Users/dan/.rvm/rubies/default/lib/ruby/1.9.1/x86_64-darwin11.4.0/openssl.bundle
which had references to the non-existent /sw/lib/libssl.1.0.0.dylib file.
Then
$ sudo brew update && sudo brew upgrade
$ rvm reset
brought my version up from 1.9.1 to
$ ruby --version
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
At which point I had to re-install bundler (?)
$ gem install bundler
But finally I could run 'bundle' on my project and it seemed to behave.
Homebrew changed its version of Openssl to 1.1 days ago
(Homebrew/homebrew-core#0349a7c 25 and Homebrew/homebrew-core#b4b9c1c
10). We can downgrade Openssl to the older version to temporarily fix
this issue while waiting for the new rebuild to come (or do it
manually):
So I solved like this:
brew uninstall --ignore-dependencies openssl
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/30fd2b68feb458656c2da2b91e577960b11c42f4/Formula/openssl.rb
UPDATE
From catalina you could get a message like:
Error: Calling Installation of openssl from a GitHub commit URL is disabled!
In this case I recomend you to go to the URL and download the content into a file (with name openssl.rb). Then you can do:
brew install openssl.rb
All the versions of rubies were working for me and I got a project on ruby 2.6.5. then I got this library not found error for openssl. To solve that, I did
brew update
brew upgrade
brew install openssl
Then all the other versions stop working because it library not found for open ssl. Since I am using chruby for ruby version manager, I remove the version folder and reinstall them and it works.
Tl;dr update and upgrade brew, install openssl and reinstall ruby version
rbenv user here, tried a couple of the solutions above but nothing worked until I uninstalled the version of ruby I had and reinstalled.
So:
rbenv uninstall 2.4.3
rbenv install 2.4.3
fixed my issue and I was able to bundle.
In my case it was the Ruby version when bundling:
I did:
rvm list
output:
ruby-1.9.3-p448 [ x86_64 ]
ruby-2.0.0-p247 [ x86_64 ]
ruby-2.0.0-p353 [ x86_64 ]
ruby-2.0.0-p451 [ x86_64 ]
and then I changed to ruby-2.0.0-p451:
rvm use ruby-2.0.0-p451
and:
bundle
bundle was done successfully ;)
I had a problem with the postgres gem pg and found this issue: https://github.com/ged/ruby-pg/issues/322
This is what I did to fix it:
brew reinstall postgresql
In my case an update with ReactJS + Node env screwed one rails project and after expending a lot of time either reinstalling ruby version via rbenv (was 2.5.1 BTW) and also reinstall openssl via homebrew, bundler reinstall (none of these worked) a simple
brew update && brew upgrade
did the trick!
was running OSX and mojave
brew update && brew upgrade
worked for me
Related
I get the following error when running rspec after I added the vcr gem. Simply running gem install psych -- --enable-bundled-libyaml as suggested doesn't solve the problem. I am using rbenv and ruby-build and I am on ruby 2.1.1. What do i have to do to fix this?
SafeYAML Warning
----------------
You appear to have an outdated version of libyaml (0.1.4) installed on your system.
Prior to 0.1.6, libyaml is vulnerable to a heap overflow exploit from malicious YAML payloads.
For more info, see:
https://www.ruby-lang.org/en/news/2014/03/29/heap-overflow-in-yaml-uri-escape-parsing-cve-2014-2525/
The easiest thing to do right now is probably to update Psych to the latest version and enable
the 'bundled-libyaml' option, which will install a vendored libyaml with the vulnerability patched:
gem install psych -- --enable-bundled-libyaml
First, you have to update Ruby-build, they have recently patched this security issue. Now, it installs libyaml 0.1.6 to compile Ruby.
$ rm -rf ~/.rbenv/plugins/ruby-build
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
Recompile, reinstall the Ruby version you are using, 2.0.0-p451 in my case:
$ rbenv install 2.0.0-p451
rbenv: /home/ubuntu/.rbenv/versions/2.0.0-p451 already exists
continue with installation? (y/N) y
Downloading yaml-0.1.6.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/5fe00cda18ca5daeb43762b80c38e06e
...
And it worked in my case.
I just followed the instructions in this reply https://stackoverflow.com/a/9510209/816002 and it seems to have done the trick. I did it slightly different however:
rvm pkg install libyaml
rvm get stable
rvm reinstall all --force
This might not help if you are using system Ruby, and will obviously be different with rbenv.
As a user of rvm, I managed to get my set up to play ball by building 0.1.6 release of libyaml, then (re)installing Ruby, passing the following configure flag
rvm install 1.9.3 -- --with-libyaml-dir=/usr/local
Hope this helps people in the short-term until the dust settles.
If you're on Mac OS X / Mavericks then you may be running on the system-installed Ruby. Thoughbot encourages you not to do this. I was having this problem as well, so I followed their advice and installed brew and rbenv and the problem went away.
For rvm this worked for me:
rvm pkg install libyaml
$LIBYAML_PATH will be the path where RVM installs the upated yaml
rvm get stable
rvm reinstall all --force --with-libyaml-dir=$LIBYAML_PATH
http://synaptian.com/2014/04/fixing-the-safeyaml-warning-on-ubuntu-12-04-with-rvm/
I just discovered I can no longer gem push … any more and some digging led me to a need to update my RVM SSL certs.
I ran rvm osx-ssl-certs status all but that gave me:
/Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': dlopen(/Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/x86_64-darwin12.4.0/openssl.bundle, 9): Library not loaded: /opt/local/lib/libssl.1.0.0.dylib (LoadError)
Referenced from: /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/x86_64-darwin12.4.0/openssl.bundle
Reason: image not found - /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/x86_64-darwin12.4.0/openssl.bundle
from /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/openssl.rb:17:in `<top (required)>'
from /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
Certificates for /usr/local/etc/openssl/cert.pem: Up to date.
Certificates for : Old.
Certificates for /etc/openssl/cert.pem: Up to date.
rvm -v shows I am running the latest RVM (as of today)
rvm 1.22.15 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
Oddly I am not sure why it's referring to ruby-2.0.0-p195 however as rvm list gives
rvm rubies
ruby-1.9.3-p392 [ x86_64 ]
ruby-2.0.0-p195 [ x86_64 ]
=* ruby-2.0.0-p247 [ x86_64 ]
Any ideas how to fix this?
Uninstalling openssl and re-installing it worked for me.
brew remove openssl
and then
brew install openssl
Your questions mentions three paths /opt/local, /usr/local and /etc/openssl they belong to Macports, Homebrew and SM Framework respectively.
As the last one is used to build static rubies it is harmeless and not related to the problem. The other two suggest that you have switched from macports to homebrew between installing the rubies.
You need to reinstall ruby-2.0.0-p195 which is referring still the old paths from macports, you can do it with:
rvm reinstall ruby-2.0.0-p195
You can get more details about the rubies and openssl paths they use running:
rvm --debug osx-ssl-certs update all
Trying to run 'bundle' I also started getting the openssl dylib complaint, though a slightly different path.
I tried most of these, and a few other things. I had rvm, and some broken remnants of a fink install, though I'd tried to replace it with brew a while back.
Many times I was getting
Library not loaded: /sw/lib/libssl.1.0.0.dylib
However trying to re-install openssl with brew always produced
sudo brew link openssl
Warning: openssl is keg-only and must be linked with --force
Note that doing so can interfere with building software.
or
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
So it was pretty confusing what I should do. What seemed to help in the end, after much trial, included:
$ rm /Users/dan/.rvm/rubies/default/lib/ruby/1.9.1/x86_64-darwin11.4.0/openssl.bundle
which had references to the non-existent /sw/lib/libssl.1.0.0.dylib file.
Then
$ sudo brew update && sudo brew upgrade
$ rvm reset
brought my version up from 1.9.1 to
$ ruby --version
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
At which point I had to re-install bundler (?)
$ gem install bundler
But finally I could run 'bundle' on my project and it seemed to behave.
Homebrew changed its version of Openssl to 1.1 days ago
(Homebrew/homebrew-core#0349a7c 25 and Homebrew/homebrew-core#b4b9c1c
10). We can downgrade Openssl to the older version to temporarily fix
this issue while waiting for the new rebuild to come (or do it
manually):
So I solved like this:
brew uninstall --ignore-dependencies openssl
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/30fd2b68feb458656c2da2b91e577960b11c42f4/Formula/openssl.rb
UPDATE
From catalina you could get a message like:
Error: Calling Installation of openssl from a GitHub commit URL is disabled!
In this case I recomend you to go to the URL and download the content into a file (with name openssl.rb). Then you can do:
brew install openssl.rb
All the versions of rubies were working for me and I got a project on ruby 2.6.5. then I got this library not found error for openssl. To solve that, I did
brew update
brew upgrade
brew install openssl
Then all the other versions stop working because it library not found for open ssl. Since I am using chruby for ruby version manager, I remove the version folder and reinstall them and it works.
Tl;dr update and upgrade brew, install openssl and reinstall ruby version
rbenv user here, tried a couple of the solutions above but nothing worked until I uninstalled the version of ruby I had and reinstalled.
So:
rbenv uninstall 2.4.3
rbenv install 2.4.3
fixed my issue and I was able to bundle.
In my case it was the Ruby version when bundling:
I did:
rvm list
output:
ruby-1.9.3-p448 [ x86_64 ]
ruby-2.0.0-p247 [ x86_64 ]
ruby-2.0.0-p353 [ x86_64 ]
ruby-2.0.0-p451 [ x86_64 ]
and then I changed to ruby-2.0.0-p451:
rvm use ruby-2.0.0-p451
and:
bundle
bundle was done successfully ;)
I had a problem with the postgres gem pg and found this issue: https://github.com/ged/ruby-pg/issues/322
This is what I did to fix it:
brew reinstall postgresql
In my case an update with ReactJS + Node env screwed one rails project and after expending a lot of time either reinstalling ruby version via rbenv (was 2.5.1 BTW) and also reinstall openssl via homebrew, bundler reinstall (none of these worked) a simple
brew update && brew upgrade
did the trick!
was running OSX and mojave
brew update && brew upgrade
worked for me
Ruby will build just fine, but it won't build with OpenSSL support. I've tried setting CC to point to both the XCode 4.6 command line tools' copy of GCC and MacPorts' version of gcc 4.2. That doesn't work. I've added --with-openssl-dir=$rvm_path/usr and --with-opt-dir=$rvm_path/usr. Neither of those work. Each time it fails, I check the log and it just says that there was an error configuring OpenSSL and that it will be skipped. Any ideas?
I had the same issue recently after installing ruby 2.0, this is how I solved:
rvm get head
rvm pkg remove
rvm requirements run
rvm reinstall 2.0.0
I found the solution in the comments reported in this Issue
i was fixing openssl issues while installing ruby on my new shiny mac yesterday.
had to reinstall ruby as #fmendez suggested
but before doing that i had to install openssl .
i did it through brew.
actually there are lot of other libraries you have to install , like automake , libxslt, etc.
i did ,
rvm requirements
it showed me what all to install.please install that first before doing the reinstall of ruby.
also i was facing issues while installing 1.8.4 , for that i had to do
rvm install 1.18.4--with-gcc=clang --without-tcl --without-tk
for installing ruby 1.9.2 , i had to do
rvm install --with-gcc=clang
hope it helps
Yes, I know there's some questions posted regarding issues of installing Ruby 1.9.3 on Lion, mainly because of problems with later versions of Xcode (4.3.2 in my case).
However, I've tried all there is to try that's posted here on Stack regarding this manner, and nothing helps. It starts to compile, one minute or two passes and then suddenly halts.
As examples I've tried with the following (of course I have GCC installer installed):
rvm install 1.9.3
rvm install 1.9.3 --with-gcc=clang
rvm install 1.9.3 --with-gcc=gcc-4.2
If running rvm install 1.9.3 the following error shows during the compilation (which halts the installation):
Error running 'make', please read /Users/henrikpetersson81/.rvm/log/ruby-1.9.3-p374/make.log
There has been an error while running make. Halting the installation.
Here you can read the log file from the latest build fail:
http://jsfiddle.net/hyhrk/
Last thing I've tried was to follow the updated guide in this answer. Same problem.
What can be the problem here?
NOTE. I've the following installed:
Ruby 1.8.7
Homebrew 0.7.1
RVM 1.17.10
GCC installer 4.2.1
Xcode 4.3.2
Command Line Tools
RVM has an updated command to install all required libraries:
rvm get head
rvm requirements run
It might ask you for your password (for sudo).
After that run:
rvm install 1.9.3 --with-opt-dir=`brew --prefix readline` --without-tcl --without-tk
Update RVM 1.19+
RVM takes care of it all:
rvm get stable
rvm autolibs homebrew
rvm install 1.9.3
It looks like there are issues with readline. Since you're using Homebrew, you can try this:
brew install readline
rvm install 1.9.3 --with-readline=`brew --prefix readline`
I'm having a lot of trouble getting Ruby 1.8.7 installed on my clean install of Mountain Lion. I've looked around on Stack Overflow and don't see anything that specifically addresses this issue and hope that someone might have encountered this before.
I'm using the command line tools that can be downloaded with Xcode
I haven't had any problems installing Ruby 1.9.3 via RVM and HomeBrew. When I try to install 1.8.7 I get the following message after it tries to compile:
I first ran the command
rvm install 1.8.7
This gave me this error
The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.
After digging around a bit I tried
rvm install 1.8.7 --with-gcc=clang
Error running 'make ', please read /Users/paulzaich/.rvm/log/ruby-1.8.7-p370/make.log
There has been an error while running make. Halting the installation.
Ruby 'ruby-1.8.7-p370' was built using clang - but it's not (fully) supported, expect errors.
Please be aware that you just installed a ruby that requires 2 patches just to be compiled on up to date linux system.
This may have known and unaccounted for security vulnerabilities.
Please consider upgrading to Ruby 1.9.3-194 which will have all of the latest security patches.
At this point I did some more searching and found something about needing compile my own readline. RVM Does Not Install Ruby 1.9.2 on Snow Leopard: 'Error running 'make '
This unfortunately seemed to corrupt my entire rvm install including 1.9.3. I tried to reinstall 1.9.3 and got the same errors I as I was getting with 1.8.7. I completely deleted RVM at this point and reinstalled. Had no problem installing 1.9.3 again.
I also tried updating all versions of rvm based off of this post RVM issue with Mountain Lion. No luck there either.
Update: I also tried using this walkthrough for REE 1.8.7 which recommended installing gcc-4.2. No luck unfortunately.
Update 2: I reference rvm requirements and installed the following packages
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
rvm pkg install openssl
So far so good. Then I referenced this post on needing to reference the GCC compiler. I determined that the links referenced might not be correct because I'm using homebrew? I found the compiler in my Cellar folder and used the following command
CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 rvm install 1.8.7
No luck. Same error messages as before.
I just figured it out! Please reference this question on SO
rvm can no longer install 1.8.7-p352 on Mac OS X Mountain Lion
rvm reinstall 1.8.7 --without-tcl --without-tk
Alternatively, try this installation order if you have Homebrew.
brew install tcl-tk
rvm reinstall 1.8.7
Just to follow up to Paul's post. I'm running OSX 10.8.2, had 1.9.3 install without issues, but 1.8.7-p370 also failed. I symlinked gcc-4.2:
sudo ln -s /usr/local/bin/gcc-4.2 /usr/bin/gcc-4.2
...successfully ran:
brew install tcl
...but tk failed:
brewk install tk
If you're in the same spot, this command did the trick:
CC=/usr/local/bin/gcc-4.2 rvm reinstall 1.8.7 --without-tk
Latest Xcode provides only clang - not GNU gcc, you need to install gcc-4.2 to be able to compile Ruby 1.8.7 properly, following command will show available options:
rvm requirements
currently only ruby 1.9.3-p125 and later has limited support for clang, but this is limited support, and still errors can be found.