mpartan
mpartan

Reputation: 1316

RVM issue with macOS Sierra while installing Ruby 2.2.6

I'm running OSX (10.12.3) and I have Ruby installed (2.2.2) which is working fine. I'm trying to upgrade to 2.2.6 using RVM. Install seems to go fine.

  - rvm install 2.2.6
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.12/x86_64/ruby-2.2.6.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /location/.rvm/rubies/ruby-2.2.6, this may take a while depending on your cpu(s)...
ruby-2.2.6 - #downloading ruby-2.2.6, this may take a while depending on your connection...
ruby-2.2.6 - #extracting ruby-2.2.6 to /location/.rvm/src/ruby-2.2.6....
ruby-2.2.6 - #configuring..........................................................
ruby-2.2.6 - #post-configuration.
ruby-2.2.6 - #compiling...........................................................
ruby-2.2.6 - #installing..........
ruby-2.2.6 - #making binaries executable..
ruby-2.2.6 - #downloading rubygems-2.6.10
ruby-2.2.6 - #extracting rubygems-2.6.10.....
ruby-2.2.6 - #removing old rubygems.........
$LANG was empty, setting up LANG=en_US, if it fails again try setting LANG to something sane and try again.
ruby-2.2.6 - #installing rubygems-2.6.10.....................
ruby-2.2.6 - #gemset created /location/.rvm/gems/ruby-2.2.6@global
ruby-2.2.6 - #importing gemset /location/.rvm/gemsets/global.gems................................................
ruby-2.2.6 - #generating global wrappers........
ruby-2.2.6 - #gemset created /location/.rvm/gems/ruby-2.2.6
ruby-2.2.6 - #importing gemsetfile /location/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.2.6 - #generating default wrappers........
ruby-2.2.6 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.2.6 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri

But when I try following commands, I'll get some errors.

  - bundle
-bash: bundle: command not found
  - gem install bundler
ERROR:  While executing gem ... (Gem::Exception)
    Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources    

So while installation seems to go fine, it can't require openssl when trying to install any gem. What might be the issue here and how could I fix it?

Upvotes: 3

Views: 1488

Answers (2)

neemiasvf
neemiasvf

Reputation: 46

If you still don't have Homebrew installed, you should go ahead and give it a try. As they say, "Homebrew installs the stuff you need that Apple didn’t," which in your case is openssl.

  1. Install Homebrew: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Install openssl: brew install openssl
  3. Try installing bundler again: gem install bundler

To avoid problems in the future, I suggest you take a look at RVM Autolibs. It automatically installs any dependency you need using Homebrew or other manager. If you don't wanna read the documentation, just run: rvm autolibs enable && rvm autolibs packages && rvm autolibs homebrew and you'll be fine.

Upvotes: 1

mpartan
mpartan

Reputation: 1316

I tried purging whole RVM and a clean reinstall, which didn't help. Using the answer by phq from here I managed to get it working.

rvm remove 2.2.6   
rvm pkg install openssl
rvm install 2.2.6 --with-openssl-dir=$HOME/.rvm/usr
gem install bundler
bundle

It's probably not the best solution as it manually loads openssl, but it seems to currently be the only solution that works for me.

Upvotes: 3

Related Questions