Having trouble installing RVM/Ruby in my first Vagrant Box

Hello. I'm in desperate need of help with this. So I haven't done much on my own outside of my coding bootcamp I graduated from yet. They had me download a set of files that included everything set up for Vagrant. But I wanted to recreate the environment for myself so that everything came from me and doesn't have any files related to the bootcamp anymore.

I'm going through the tutorial of just creating the folder you want your code environment in, running the vagrant init command int he terminal and creating everything that way. I'm at the point of installing RVM and Ruby, specifically 2.7.1 which is the latest as of the time of this post. I'm getting an error though.

Here's the output when I run "rvm install ruby-2.7.1":

Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/18.04/x86_64/ruby-2.7.1.tar.bz2
Checking requirements for ubuntu.
Requirements installation successful.
ruby-2.7.1 - #configure
ruby-2.7.1 - #download
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 21.0M 100 21.0M 0 0 23.7M 0 --:--:-- --:--:-- --:--:-- 23.7M
Downloaded archive checksum did not match!
ruby-2.7.1 - #validate archive

bzip2: Data integrity error when decompressing.
Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

bzip2: Data integrity error when decompressing.
Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
ruby-2.7.1 - #extract

bzip2: Data integrity error when decompressing.
Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
Unpacking bin-ruby-2.7.1.tar.bz2 failed.
Mounting remote ruby failed with status 6, trying to compile.
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /usr/share/rvm/rubies/ruby-2.7.1, this may take a while depending on your cpu(s)...
ruby-2.7.1 - #downloading ruby-2.7.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 14.0M 100 14.0M 0 0 26.0M 0 --:--:-- --:--:-- --:--:-- 26.0M
Downloaded archive checksum did not match!
ruby-2.7.1 - #extracting ruby-2.7.1 to /usr/share/rvm/src/ruby-2.7.1......
Error running '__rvm_package_extract /usr/share/rvm/archives/ruby-2.7.1.tar.bz2 /usr/share/rvm/tmp/rvm_src_3269',
please read /home/vagrant/.rvm/log/1591896051_ruby-2.7.1/extract.log
There has been an error while trying to extract the source. Halting the installation.
There has been an error fetching the ruby interpreter. Halting the installation.

I just need to try and get this fixed so I can continue to work on my Web Dev portfolio which is based on Ruby on Rails. I'm just not understanding why I'm now having all this trouble with my development environment when using the files that the bootcamp gave me is fine. It's just that those install older versions of ruby and rails and stuff and I want the latest working versions of everything. Any help is greatly appreciated.

2 thoughts on “Having trouble installing RVM/Ruby in my first Vagrant Box”

  1. you gave no information to reproduce your situation: no vagrantfile, no information about the vagrant box used (from the logging it seems to be ubuntu 18.04), nothing about what provisioning is applied.

    Your logs show there where problems with the tarball (downloaded by `rvm` (?)); I downloaded the ruby tar.bz2 and it untars just fine.

    I’d say: you hit a network snag, just try again

    Reply
  2. RVM and similar version managers rely on very specific shell configuration load semantics.

    bash -lic can help, or place the RVM activating lines in /etc/profile.

    Such scripts are primarily intended for interactive use. For this reason RVM is best reserved for you host environment. VM’s and containers should directly install the needed Ruby versions.

    Reply

Leave a Comment