I want to install ruby on my Linux Mint 12.
I am following this tutorial and this one.
when I run rvm install 1.9.3
I see this error:
Doing an rvm update as suggested in one of the comments gave me some good errors on how to fix the problem. I purged apt-get ruby-rvm as suggested in the errors and installed with curl. Worked like a charm. Looking at the file name the apt-get version of rvm is grabbing it looks like the last part of the version is missing for some reason. Instead of ruby-1.9.3-.tar.bz2 it should be ruby-1.9.3-p327.tar.bz2 or something to that effect.
Here is what I did and what was suggested by the errors after rvm update:
sudo apt-get --purge remove ruby-rvm
sudo rm -rf /usr/share/ruby-rvm /etc/rvmrc /etc/profile.d/rvm.sh
open new terminal and validate environment is clean from old rvm settings:
env | GREP_OPTIONS= \grep rvm
install RVM:
curl -L https://get.rvm.io | bash -s stable
fix some more screwed up stuff from apt-get ruby-gem
make ~/.bash_profile look like this(it loads rvm as a function in bash):
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
update RVM:
rvm update
rvm reload
install ruby
rvm install 1.9.3
rvm use 1.9.3 --default
install current rubygems
rvm rubygems current
install rails
gem install rails
Done!
cat /usr/share/ruby-rvm/log/ruby-1.9.3/extract.log
It seems to me you don't have installed bunzip2
. You should install it
For Ubuntu 18.10, I had the same error after installing via APT. rvm install 2.5.1 failed with the same error as referenced. After completing the instructions for Ubuntu on github and restarting my VPS, ruby v 2.6.3 installed using the command 'rvm install ruby' As I was on a vps, I had to run
source /etc/profile.d/rvm.sh
first.
Github RVM Repo for Ubuntu
Issue solved, here's how in case you want to know:
As s.m. said, I uninstalled everything, then I opened another terminal session as a normal user and run:
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
then i run source /home/my-desktop-username/.rvm/scripts/rvm
as a normal user NOT ROOT
then i run rvm requirements
as a normal user. Then I copy the requirements and close the session, open a root session and install the requirements using sudo
Then I close the session and open a normal user session and run rvm install ruby-1.9.3-p125
if you run this command as root, it will say that rvm
is not installed and will suggest that you install it using sudo apt-get install rvm
Don't do that!
So basically I had two problems, the tutorials that i followed didn't say that i should run
source /home/my-desktop-username/.rvm/scripts/rvm
and didn't say that I should not run rvm
as root, s.m told me that. Thanks to everyone, especially to s.m
Don't trust bloggers, Youtube users or forums. ONLY TRUST STACKOVERFLOW USERS!
I had the same problem with bunzip2.
A tail on ~/.rvm/log/ruby-1.9.3-p125/extract.log said:
bunzip2: (stdin) is not a bzip2 file.
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
It turns out that the downloaded file was the HTML homepage of rvm website instead of the archive itself.
So if like me all previous solutions didn't worked out. Check file type of your archive:
$ file ruby-1.9.3-p125.tar.bz2
ruby-1.9.3-p125.tar.bz2: HTML document, UTF-8 Unicode text, with very long lines
If you get something like this, just remove the archive and try to install it again.
Uninstall and reinstall rvm
with
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
For posterity, I'll add that the part of the error that says
Installing Ruby from source to: /usr/share/...
is what got me thinking about a broken installation of rvm which, as I said, is normally entirely contained in the ~/.rvm
directory.