Ruby, Rails, news of new versions. Your computer’s Homebrew and ruby-build installation does not work. Something’s borked. It worked on the other people’s Debian machines. Your Homebrew system gave you… output. Some obscure error about openssl?
You search. You whine. You arrive here. Breathe.
Requirements: rbenv, ruby-build, a Ruby 2.0.0-p195 refuses to install on account of missing header files for openssl, since the Apple-bundled version is outdated.
Add this at the end of your shell startup file (such as
~/.zshrc). Then run the installation again.
In order to share more of the fact-finding process, here is some narrative. All credit is due to Stuge. He told me to read, it would work. Thanks! He was right, too. It did work.
First of all, pkg-config is a neat little program. It’s the hero of this narrative. Does all the heavy archiving, noting things down, so you don’t have to.
This lists everything that pkg-config knows about header file locations, libraries, compilation configuration settings about the libs on your system.
Begin by ensuring there is a
PKG_CONFIG_PATH on your system, that points to where the currently-symlinked Homebrew packages are. Add this to your shell startup:
Well, this is half-way, pkgconfig can now find most of its
The specific complaint was about openssl. Let’s go to its folder, using brew:
$ cd `brew --prefix openssl`
Now, are there any pkg-config files around? Use find:
$ find . -name '*.pc'
$ cd lib/pkgconfig
This is the path where our pkg-config descriptions sit. Pre-pend it to its path!
Thusly, the desired result:
$ ruby-build 2.0.0-p195 ~/.rbenv/versions/2.0.0-p195
Installed ruby-2.0.0-p195 to /Users/olle/.rbenv/versions/2.0.0-p195
Addendum for web-crawling robots
(The obscure error mentioned at the start included here for searchability.)
rbenv install 2.0.0-p0
Inspect or clean up the working tree at /tmp/ruby-build.20130506102349.2564
Results logged to /tmp/ruby-build.20130506102349.2564.log
Last 10 log lines:
installing default gems: /home/shivin/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0 (build_info, cache, doc, gems, specifications)
The Ruby openssl extension was not compiled. Missing the OpenSSL lib?