Install Ruby on Unix platform without root permission

2

3

I'm working on a Unix platform on VNC viewer. Now I want to upgrade to Ruby version 1.9.2.

I don't have root permissions. So is there any way by which I could install Ruby 1.9.2?

Sundar

Posted 2011-05-13T10:00:09.033

Reputation: 23

Answers

2

Step 1: Install RVM

You can always install Ruby over rvm, which can be run as a single user.

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

or, if you don't have git:

curl -s https://rvm.beginrescueend.com/install/rvm -o rvm-installer ; chmod +x rvm-installer ; ./rvm-installer --version latest

Then run the following to put rvm into your .bash_profile:

echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile

Reload the shell config:

source ~/.bash_profile

Step 2: Install Ruby 1.9.2

Finally, install Ruby 1.9.2:

rvm install 1.9.2

You can setup rvm to use it as default:

rvm --default use 1.9.2

slhck

Posted 2011-05-13T10:00:09.033

Reputation: 182 472

hey thank u for your reply.. But this gives me an error stating: chmod: getting attributes of `rvm-installer': No such file or directory ./rvm-installer: Command not found If i execute the first bash cmd it says: Missing name for redirect – Sundar – 2011-05-13T10:19:11.780

@Sundar Try to break it up: Does the following work? curl -s https://rvm.beginrescueend.com/install/rvm -o rvm-installer – slhck – 2011-05-13T10:24:21.557

yes this works but next when i execeute "chmod +x rvm-installer" it gives out that error – Sundar – 2011-05-13T10:26:40.620

hey i've one more problem.. if i execute the curl cmd without -s (used for don output anything) it says: curl: (6) Couldn't resolve host 'rvm.beginrescueend.com' – Sundar – 2011-05-13T10:39:42.200

So can you ping the host then? – slhck – 2011-05-13T10:49:37.533

it says "unknown host"... maybe will it work if i try to download the rvm-installer in my windows and transfer it to my vnc??? – Sundar – 2011-05-13T10:53:20.330

@Sundar No, because wenn you call rvm install it will try to download Ruby again, and that's where it doesn't work anymore. I suggest you try to get proper internet connection on your other machine first. Is pinging other hosts working? – slhck – 2011-05-13T10:59:04.807

@slhck hey i think tats the problem.. thank u so much for ur replies.. – Sundar – 2011-05-13T11:10:16.837