menu

Questions & Answers

RVM Error when installing Ruby using WSL2 on Ubuntu: Error running '__rvm_make -j16'

I am reinstalling my environment after reinstalling windows 10. I was given instructions for installing WSL2 and using the Ubuntu distro, nvm and then node.js, and then rvm and ruby. My organization wants us on ruby version 2.7.4 specifically. I am sure that if I posted the full instructions that wouldn't be allowed, but I am going to post the code they tell us to run to see if anyone knows why I get this error. I have gotten it to work on this machine before, and these steps are repeatable on other windows machines because I setup an environment on my laptop.

Here are the steps I was told to follow:

1. Install Windows Subsystem for Linux (WSL) and Ubuntu • Search for the "Command Prompt" application using the "Start" menu • Select "Run as administrator" from the right side of the search window • Allow the program to make changes to your device and wait for the "Command Prompt" application to open • Type wsl --install -d Ubuntu and press • The terminal should output "The requested operation is successful." • Restart your computer to complete the installation. • Open the "Ubuntu" application • When it says "Enter new UNIX username:" add a simple username and press (Note: usernames may not start with a number, and may not include capital letters) • Where it says "New password:" add a simple password and press (Note: you will not see any text when you are typing your password.) • Where it says "Retype new password:" retype the same password from before and press (Note: store this password somewhere safe. You will need it to be able to run commands in the future) • The terminal should output "Installation successful!" and then print about 50 lines that you can ignore • Type wsl --set-default-version 2 into the terminal and press (Note: you should see a message starting with "For information on key differences…") • Type wsl --status into the terminal and press . You should see a message including "Default Version 2", which verifies that the default version has been set correctly. • Type wsl --set-version Ubuntu 2 into the terminal and press Wait for the "Conversion complete" or "This distribution is already the requested version" message in the terminal • Type wsl --list --verbose into the terminal and press . You should see a message including "NAME Ubuntu VERSION 2", which verifies that the default version has been set correctly. 2. Install Node Version Manager (NVM) on Ubuntu • Open the "Ubuntu" application using the "Start" menu • Type curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash and press • Close the "Ubuntu" application • Reopen the "Ubuntu" application • Type nvm and press • If you see a message ending with "Note: to remove, delete, or uninstall nvm", continue below. 3. Install Node.js on Ubuntu • Open the "Ubuntu" application using the "Start" menu • Type nvm install --lts and press • Type nvm list and press • If you see a message starting with "-> v16.0.0" (or any higher number, like "-> 16.11.1"), continue to the next lesson 4. Install Ruby Environment Manager (RVM) on Ubuntu • Open the "Ubuntu" application using the "Start" menu • Type sudo apt-get install software-properties-common and press You may be asked to enter your Ubuntu terminal password • Type sudo apt-add-repository -y ppa:rael-gc/rvm and press • Type sudo apt-get update and press • Type sudo apt-get install rvm and press (Note: if you are asked "Do you want to continue [Y/n]", type "Y" and press ) • Type sudo usermod -a -G rvm $USER and press • Close the "Ubuntu" application • Open the "Ubuntu" application using the "Start" menu • Type rvm and press • If you see a long message ending in "For additional documentation, please visit https://rvm.io This is an external link.", continue below 5. Install Ruby Version 2.7.4 on Ubuntu (This is the part I can't get to work) • Open the "Ubuntu" application using the "Start" menu • If the "Ubuntu" application is still open from the last step, close and re-open to prevent errors with running the next command. • Type rvm install 2.7.4 --default and press • Enter your Ubuntu password if prompted • Type rvm list and press • If you see a message starting with =* ruby-2.7.4, continue below • If you encounter issues installing a version of Ruby via RVM, try the following in Ubuntu: • Run rvm group add rvm $USER • Close Ubuntu and reopen • Run rvm fix-permissions • After running the last command, try installing Ruby again with rvm install 2.7.4 --default • If you are continuing to have issues installing RVM, try running the following: $ sudo usermod -a -G rvm $USER • After running, try installing Ruby again.

The install seems to fail when compiling and I get this error message:

"Error running '__rvm_make -j16', please read /home/dylan9706/.rvm/log/1671650995_ruby-2.7.4/make.log

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

Any help would be appreciated. Thanks!

Answers(1) :

I also ran into the exact same problem. After googling i found out that Ubuntu 22.04.1 LTS uses a different version of openssl, i think its 3. You need version 1 of open ssl to install old ruby binaries. Here is what i did

  1. $ sudo apt install build-essential
  2. $ cd ~/Downloads
  3. $ wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz
  4. $ tar zxvf openssl-1.1.1g.tar.gz
  5. $ cd openssl-1.1.1g $ ./config --prefix=$HOME/.openssl/openssl-1.1.1g --openssldir=$HOME/.openssl/openssl-1.1.1g
  6. $ make
  7. $ make test (you might get a few tests failing but just ignore)
  8. $ make install
  9. $ rm -rf ~/.openssl/openssl-1.1.1g/certs
  10. $ ln -s /etc/ssl/certs ~/.openssl/openssl-1.1.1g/certs
  11. $ cd ~
  12. $ rvm install ruby-X.X.X --with-openssl-dir=$HOME/.openssl/openssl-1.1.1g (where ruby-X.X.X is the version you want to install
Comments:
2023-01-07 20:30:22
or you can downgrade to ubuntu v20