Skip to content

Instantly share code, notes, and snippets.

@sutanto
Last active October 19, 2020 05:27
Show Gist options
  • Save sutanto/2a72ee90a4b3e6b7ff3da815ebfbd3cb to your computer and use it in GitHub Desktop.
Save sutanto/2a72ee90a4b3e6b7ff3da815ebfbd3cb to your computer and use it in GitHub Desktop.
Install curb 0.9.3 on MacOS Catalina
# You'll probably also need to Install Ruby 2.3.x with OpenSSL 1.0 (on Catalina),
# follow this gist *before* you install curb: https://gist.github.com/sutanto/75a778f94edae116aeaa5ec56955ce58
# Recent Homebrew version no longer allow the `brew install formula` command, we'll need to create our own "custom" tap:
brew tap-new sutanto/homebrew-versions
# make sure that we don't use the "shallow" local homebrew repo
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow
# extract the required curl version
brew extract --version 7.35.0 curl sutanto/homebrew-versions
# finally install it
# brew command below will fail with “Error: undefined method `strip' for :provided_by_osx:Symbol”, ignore this, the install is still completed successfully
brew install sutanto/homebrew-versions/curl@7.35.0
gem install curb -v '0.9.3' -- --with-openssl-dir=/usr/local/opt/openssl --with-curl-dir=/usr/local/opt/curl@7.35.0
@alexey
Copy link

alexey commented Apr 18, 2020

I had similar issue of mix of curl(and curl-openssl).
It turns out, OpenSSL 1.1 isn’t compatible with Ruby 2.3.x, and I probably just accidentally installed 1.1 instead of 1.0

I can add my tries for you:

  1. TRY 1: include pkg config for existing openssl and set options for rvm
PKG_CONFIG_PATH=/usr/local/opt/openssl@1.0/lib/pkgconfig rvm install 2.3.8  --with-openssl-lib=/usr/local/opt/openssl@1.0 --with-openssl-include=/usr/local/opt/openssl@1.0/include
  1. TRY2: the brew solve problem with the commands:
brew update
brew uninstall openssl
brew install openssl101

if this is not worked at any step try:

brew install rbenv/tap/openssl@1.0
# Now ensure you are reload console to get new vars (or just open a new console)
rvm install ruby-2.3.8  --with-openssl-dir=`/usr/local/opt/openssl@1.0`

(or reinstall).

Use any path to your local ssl installation, like /usr/local/opt/openssl, mind not to set it to binaries folder but to relative root folder of openssl 1.0

  1. The RVM issue:

UNINSTALL rvm with rvm implode - follow the post uninstall instructions, then install rvm from scratch, then:

rvm pkg install openssl
rvm install 2.3.8 --with-openssl-dir=$rvm_path/usr
  1. Install curl-openssl:
    With brew and set --with-curl-dir=/usr/local/opt/curl-openssl (or any your path to it) option to $ rvm command. Yes its another curl called curl-openssl. Do not update $PATH or your *rc files with path to it unless you want curl-openssl by default

Finally:
bundle install

Notes:

  • It may need mix commands from different steps above, i just ordered them as i tried to solve issue.
  • Open a new console each time you install/uninstall rvm/openssl/curl
  • Keep eye on paths (eg: which curl)

@sutanto
Copy link
Author

sutanto commented Apr 19, 2020

@alexey, in the gist above, I put a link to https://gist.github.com/sutanto/75a778f94edae116aeaa5ec56955ce58 which described how to install Ruby 2.3 with OpenSSL 1.0.
I'll change the comment in the gist above so it'll be more obvious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment