rvm / ubuntu_rvm

Ubuntu package for RVM
https://launchpad.net/~rael-gc/+archive/ubuntu/rvm
Apache License 2.0
694 stars 84 forks source link

rvm install ruby gives error - Error running '__rvm_make -j4' on Ubuntu 22 #74

Closed mike1011 closed 1 year ago

mike1011 commented 1 year ago

Description

I am using VirtualBox 7 on my Windows 11 OS to install Ubuntu 22.02. I am installing rvm for a Ruby on Rails project, which I have done thousand of times earlier too uring rvm, but this one is getting a bit time consuming, so wanted to share it here. I did tried many things listed below but everytime I get Error running '__rvm_make -j4'

Things I tried -

  1. Rvm installing/uninstalling many times referring the site rvm.io but still I get the same error.
  2. I also tried using commands like --with-openssl but even that doen't works
  3. I followed all the steps which include adding keyserver, installing and repairing,reloading rvm too.

Steps to reproduce

     gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
     sudo apt-get install software-properties-common
     sudo apt-add-repository -y ppa:rael-gc/rvm
    sudo apt-get update
    sudo apt-get install rvm
    exit
    cd /home/mike/workspace/
    source /etc/profile.d/rvm.sh
    sudo usermod -a -G rvm $USER
    echo 'source "/etc/profile.d/rvm.sh"' >> ~/.bashrc
    exit
    cd /home/mike/workspace/
    rvm install ruby
    exit
    reboot
    cd /home/mike/workspace/
    rvm install ruby
    sudo nano /usr/share/rvm/log/1669672874_ruby-3.0.0/make.log

output of make.log

---output of make.log----first/last few lines

--first few lines--- GNU nano 6.2 /usr/share/rvm/log/1669672874_ruby-3.0.0/make.log
[2022-11-29 03:31:36] rvm_make __rvm_make () { \make "$@" || return $? } current path: /usr/share/rvm/src/ruby-3.0.0 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/usr/share/rvm/bin:/home/mike/.rvm/bin:/home/mike/.> command(2): rvm_make -j4 ++ make -j4 BASERUBY = echo executable host ruby is required. use --with-baseruby option.; false CC = gcc LD = ld LDSHARED = gcc -shared CFLAGS = -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpoint> XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -I. -I.ext/include/> CPPFLAGS = DLDFLAGS = -Wl,--compress-debug-sections=zlib -Wl,-soname,libruby.so.3.0 -fstack-protector-strong SOLIBS = -lz -lpthread -lrt -lrt -lgmp -ldl -lcrypt -lm LANG = en_IN LC_ALL = LC_CTYPE = MFLAGS = -j4 --jobserver-auth=4,5 gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

compiling ./main.c compiling dmydln.c compiling miniinit.c compiling dmyext.c making dummy probes.h compiling ast.c compiling bignum.c compiling class.c compiling compar.c compiling compile.c compiling complex.c compiling cont.c

----last few lines ---- compiling ./main.c compiling dmydln.c compiling miniinit.c compiling dmyext.c making dummy probes.h compiling ast.c compiling bignum.c compiling class.c compiling compar.c compiling compile.c compiling complex.c compiling cont.c

- output of rvm info

Expected behavior

ruby is successfully installed after executing the command - rvm install ruby-2.6

Actual behavior


mike@my-computer:~$ /bin/bash --login
mike@my-computer:~$ cd /home/mike/workspace/
mike@my-computer:~/workspace$ rvm install ruby
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/22.04/x86_64/ruby-3.0.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /usr/share/rvm/rubies/ruby-3.0.0, this may take a while depending on your cpu(s)...
ruby-3.0.0 - #downloading ruby-3.0.0, 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 18.6M  100 18.6M    0     0  6054k      0  0:00:03  0:00:03 --:--:-- 6055k
ruby-3.0.0 - #extracting ruby-3.0.0 to /usr/share/rvm/src/ruby-3.0.0.....
ruby-3.0.0 - #configuring.........................................................................
ruby-3.0.0 - #post-configuration..
ruby-3.0.0 - #compiling..............................................................................................................................................|
Error running '__rvm_make -j4',
please read /usr/share/rvm/log/1669672874_ruby-3.0.0/make.log

There has been an error while running make. Halting the installation.

Environment info

mike@my-computer:~/workspace$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"

Hope I have added all the required details.Let me know if I am missing something here. Adding make.log as an attachment. make.log

mike1011 commented 1 year ago

I think It might be related to OpenSSL3.0, which is the default version available in Ubuntu 22, which only requires ruby 3+.Need to investigate more on this. This is a reference of the issue listed on Stackoverflow - link

mike1011 commented 1 year ago

It worked...sharing what I tried...Let me know if there were other workarounds too -

rvm pkg install openssl
rvm install 2.6 --with-openssl-dir=/usr/share/rvm/usr 

output  ----
mike@my-computer:~/workspace$ rvm list
=* ruby-2.6.6 [ x86_64 ]

# => - current
# =* - current && default
#  * - default
mike1011 commented 1 year ago

Strange thing now...I am getting - Segmentation Fault error when I run rake db commands...during setting up my database. Maybe issue with rvm and the ruby that is installed.... Not sure whats wrong...still looking into it.

mike@my-computer:~/workspace/demo$ which a rake
/usr/share/rvm/gems/ruby-2.7.2@demo/bin/rake
mike@my-computer:~/workspace/demo$ echo $PATH
/usr/share/rvm/gems/ruby-2.7.2@demo/bin:/usr/share/rvm/gems/ruby-2.7.2@global/bin:/usr/share/rvm/rubies/ruby-2.7.2/bin:/usr/share/rvm/bin:/home/mike/.nvm/versions/node/v14.21.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/mike/.rvm/bin:/home/mike/.rvm/bin:/home/mike/.rvm/bin:/home/mike/.rvm/bin:/home/mike/.rvm/bin
mike@my-computer:~/workspace/demo$ which rake
/usr/share/rvm/gems/ruby-2.7.2@demo/bin/rake
mike@my-computer:~/workspace/demo$ which ruby
/usr/share/rvm/rubies/ruby-2.7.2/bin/ruby
mike@my-computer:~/workspace/demo$ 
raelgc commented 1 year ago

Please check https://github.com/rvm/rvm/issues/5209#issuecomment-1134927685. It's a rvm issue.

mike1011 commented 1 year ago

Thanks @raelgc , to make things simple, I created a new VM of Ubuntu 20.04 and installed easily without a single glitch. As when I tried the command suggested by you - sudo apt install libssl-dev=1.1.1l-1ubuntu1.4, it failed complaining about missing of the suggested version of library. I will try out again on Ubuntu 22 but for now..switching back to Ubuntu 20.

Thanks.