The fight to install Ruby on Ubuntu

Today, as I went after installing Ruby on Ubuntu (14.04), never imagined it would be that much of a fight.

Actually, installing Ruby was not that much fight, as post that, installing Rails would become.

I started with installing from source, did the usual stuff required and when I checked by typing the command "ruby -v", it said ruby can't be find in /usr/bin .

Previously, as I was installing Sqlite3, I observed that got installed into /usr/local/bin and I had encountered the same error.

So I checked for Ruby at the same place and found it.

I moved everything from /usr/local/bin to /usr/bin .

I could see now the Ruby and the version .

I don't know it was the right thing to do or not, but there was no harm in checking it out, so I did. As it is, it would not have broke my machine.

when I did "whereis ruby" , it showed me where I had put in and mysteriously it appeared in /usr/local/bin also, so I forced remove it.

Now when I tried to install rails via gem, it threw up .

I tried purging ruby and re-making from the source again .

Surprising the re-making did not work at all, neither I could see the ruby version, nor "whereis" would throw any location.

I almost threw my hand up in despair, but then I decided to do it some other way and found this article on gorails site using something called "rbenv". It is a ruby versioning system and apparently at present the most popular way to install Ruby on Ubuntu.

I decided to give it a try and after a good amount of wait, was able to install both Ruby and Rails successfully.

though "whereis" would not tell me the location of Ruby. I guess, it would not work in this scenario.

This was a relief indeed.

I have worked with Ruby previously on Windows and hence never encountered such scenario.

I would have to study more detail about installing Ruby from source and why it did not work, also have to study about rbenv.

Comments

Popular posts from this blog

Coursera - CS 101 - Completed