New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You must recompile Ruby with OpenSSL - Ubuntu 18.04 - ruby 2.3.5 #4357

Open
duffyjp opened this Issue Apr 6, 2018 · 12 comments

Comments

Projects
None yet
8 participants
@duffyjp

duffyjp commented Apr 6, 2018

Description

Fresh 18.04 VM, fresh rvm, installed ruby 2.3.5 doesn't have openssl compiled in.

Steps to reproduce

18.04 desktop daily

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL https://get.rvm.io | bash
$ rvm install 2.3.5
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/18.04/x86_64/ruby-2.3.5.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Installing Ruby from source to: /home/jacob/.rvm/rubies/ruby-2.3.5, this may take a while depending on your cpu(s)...
ruby-2.3.5 - #downloading ruby-2.3.5, this may take a while depending on your connection...
$ bundle
Fetching gem metadata from http://rubygems.org/.
Could not load OpenSSL.
You must recompile Ruby with OpenSSL support or change the sources in your
Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using
RVM are available at http://rvm.io/packages/openssl.

Environment info

$ rvm info

ruby-2.3.5:

  system:
    uname:        "Linux VirtualBoxUbuntu 4.15.0-13-generic #14-Ubuntu SMP Sat Mar 17 13:44:27 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux"
    name:         "Ubuntu"
    version:      "18.04"
    architecture: "x86_64"
    bash:         "/bin/bash => GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)"
    zsh:          " => not installed"
    remote_path:  "ubuntu/18.04/x86_64"

  rvm:
    version:      "1.29.3 (master)"
    updated:      "13 minutes ago"
    path:         "/home/duffyjp/.rvm"
    autolibs:     "[disable] Limit RVM automation as much as possible."

  ruby:
    interpreter:  "ruby"
    version:      "2.3.5p376"
    date:         "2017-09-14"
    platform:     "x86_64-linux"
    patchlevel:   "2017-09-14 revision 59905"
    full_version: "ruby 2.3.5p376 (2017-09-14 revision 59905) [x86_64-linux]"

  homes:
    gem:          "/home/duffyjp/.rvm/gems/ruby-2.3.5"
    ruby:         "/home/duffyjp/.rvm/rubies/ruby-2.3.5"

  binaries:
    ruby:         "/home/duffyjp/.rvm/rubies/ruby-2.3.5/bin/ruby"
    irb:          "/home/duffyjp/.rvm/rubies/ruby-2.3.5/bin/irb"
    gem:          "/home/duffyjp/.rvm/rubies/ruby-2.3.5/bin/gem"
    rake:         "/home/duffyjp/.rvm/gems/ruby-2.3.5@global/bin/rake"

  environment:
    PATH:         "/home/duffyjp/.rvm/gems/ruby-2.3.5/bin:/home/duffyjp/.rvm/gems/ruby-2.3.5@global/bin:/home/duffyjp/.rvm/rubies/ruby-2.3.5/bin:/home/duffyjp/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/oracle"
    GEM_HOME:     "/home/duffyjp/.rvm/gems/ruby-2.3.5"
    GEM_PATH:     "/home/duffyjp/.rvm/gems/ruby-2.3.5:/home/duffyjp/.rvm/gems/ruby-2.3.5@global"
    MY_RUBY_HOME: "/home/duffyjp/.rvm/rubies/ruby-2.3.5"
    IRBRC:        "/home/duffyjp/.rvm/rubies/ruby-2.3.5/.irbrc"
    RUBYOPT:      ""
    gemset:       ""

@duffyjp

This comment has been minimized.

duffyjp commented Apr 10, 2018

Mac 10.13.4

rvm install 2.5.1
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.13/x86_64/ruby-2.5.1.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Installing Ruby from source to: /Users/duffyjp/.rvm/rubies/ruby-2.5.1, this may take a while depending on your cpu(s)...
ruby-2.5.1 - #downloading ruby-2.5.1, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13.3M  100 13.3M    0     0  2872k      0  0:00:04  0:00:04 --:--:-- 3175k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.5.1 - #extracting ruby-2.5.1 to /Users/duffyjp/.rvm/src/ruby-2.5.1....
ruby-2.5.1 - #configuring......................................................|
ruby-2.5.1 - #post-configuration.
ruby-2.5.1 - #compiling........................................................-
ruby-2.5.1 - #installing..........
ruby-2.5.1 - #making binaries executable..
Installed rubygems 2.7.6 is newer than 2.6.14 provided with installed ruby, skipping installation, use --force to force installation.
ruby-2.5.1 - #gemset created /Users/duffyjp/.rvm/gems/ruby-2.5.1@global
ruby-2.5.1 - #importing gemset /Users/duffyjp/.rvm/gemsets/global.gems.........there was an error installing gem rubygems-bundler
....................
ruby-2.5.1 - #generating global wrappers.......
ruby-2.5.1 - #gemset created /Users/duffyjp/.rvm/gems/ruby-2.5.1
ruby-2.5.1 - #importing gemsetfile /Users/duffyjp/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.5.1 - #generating default wrappers.......
ruby-2.5.1 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.5.1 - #complete 
Ruby was built without documentation, to build it run: rvm docs generate-ri
ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
gem install bundler
ERROR:  While executing gem ... (Gem::Exception)
    Unable to require openssl, install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources

Update

This fixed things for MacOS

xcode-select --install

found here: brianmario/mysql2#872 (comment)

@casivaagustin

This comment has been minimized.

casivaagustin commented Apr 15, 2018

Install these packages to make it work in ubuntu

sudo apt-get install zlib1g-dev libssl-dev

@der-flo

This comment has been minimized.

der-flo commented Apr 16, 2018

@casivaagustin Does not work for me on Ubuntu 18.04 Beta 2, the packages are installed.

@der-flo

This comment has been minimized.

der-flo commented Apr 16, 2018

libssl1.0-dev helps

@gkalil

This comment has been minimized.

gkalil commented Apr 27, 2018

Any fix for Ubuntu 18.04?

@der-flo

This comment has been minimized.

der-flo commented Apr 27, 2018

@gkalil apt purge libssl-dev && apt install libssl1.0-dev

@gkalil

This comment has been minimized.

gkalil commented Apr 30, 2018

After i do apt install libssl1.0-dev i get
get /usr/share/rvm/scripts/base: No such file or directory when trying to do rvm install 2.3.5

@gkalil

This comment has been minimized.

gkalil commented May 1, 2018

I finally got it working doing sudo apt purge libssl-dev && sudo apt install libssl1.0-dev and then using rbenv instead of rvm to install older ruby versions.

@samuelebistoletti

This comment has been minimized.

samuelebistoletti commented May 21, 2018

Got it working also with RVM:

1. sudo apt purge libssl-dev && sudo apt install libssl1.0-dev
2. rvm install 2.3.5 --autolibs=disable

You must install RVM dependencies manually, otherwise, with autolibs enabled, RVM will try to update system dependencies and also libssl-dev (that you downgraded in the first step). If you don't want to manually install dependencies you can try to install Ruby with autolibs enabled, the installation will fail, at this point you have dependencies installalled, so you can downgrade libssl repeating all from step 1.

@twang2218

This comment has been minimized.

twang2218 commented May 23, 2018

Thanks @samuelebistoletti , with --autolibs=disable and libssl1.0-dev, I installed the 2.3.7 on Ubuntu 18.04 via rvm.

ζ rvm install ruby-2.3.7 --autolibs=disable                                                                                 
ruby-2.3.7 - #removing src/ruby-2.3.7..
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/18.04/x86_64/ruby-2.3.7.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Installing Ruby from source to: /home/tao/.rvm/rubies/ruby-2.3.7, this may take a while depending on your cpu(s)...
ruby-2.3.7 - #downloading ruby-2.3.7, this may take a while depending on your connection...
ruby-2.3.7 - #extracting ruby-2.3.7 to /home/tao/.rvm/src/ruby-2.3.7....
ruby-2.3.7 - #configuring..........................................................
ruby-2.3.7 - #post-configuration..
ruby-2.3.7 - #compiling.....................................................................................................-
ruby-2.3.7 - #installing..............
ruby-2.3.7 - #making binaries executable..
ruby-2.3.7 - #downloading rubygems-2.6.14
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  751k  100  751k    0     0  2276k      0 --:--:-- --:--:-- --:--:-- 2270k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.3.7 - #extracting rubygems-2.6.14....
ruby-2.3.7 - #removing old rubygems.........
ruby-2.3.7 - #installing rubygems-2.6.14...........................
ruby-2.3.7 - #gemset created /home/tao/.rvm/gems/ruby-2.3.7@global
ruby-2.3.7 - #importing gemset /home/tao/.rvm/gemsets/global.gems...............................................
ruby-2.3.7 - #generating global wrappers........
ruby-2.3.7 - #gemset created /home/tao/.rvm/gems/ruby-2.3.7
ruby-2.3.7 - #importing gemsetfile /home/tao/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.3.7 - #generating default wrappers........
ruby-2.3.7 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.3.7 - #complete 
Ruby was built without documentation, to build it run: rvm docs generate-ri
@mikecmpbll

This comment has been minimized.

mikecmpbll commented Sep 25, 2018

do we know is it just the ruby 2.3.x or will it happen also for later rubies? just curious if upgrading ruby will resolve this, as I don't particularly want to go down the manual dependency management route.

@satriahrh

This comment has been minimized.

satriahrh commented Oct 10, 2018

I got this issue at first, fresh install of Ubuntu and RVM. Then I do nothing except reboot and it is then working well.

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