How do I install something from source and make it available to root?

Posted by pwny on Server Fault See other posts from Server Fault or by pwny
Published on 2012-04-05T15:55:18Z Indexed on 2012/04/05 17:34 UTC
Read the original article Hit count: 283

Filed under:
|
|

I have a CentOS VM and I need to install the latest version of Ruby on it. Unfortunately, yum only makes Ruby 1.8.6 available so I'm trying to install Ruby from source. Here's what I'm using:

cd /usr/src
sudo -s
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125
./configure
make && make install

The problem is that once that's done, I can only use Ruby as a regular user but I need to use it as root to install some gems. For example, as a regular user I can do ruby -v and it works but sudo ruby -v outputs bash: ruby: command not found.

What am I missing to make stuff I install from source available to all users?

© Server Fault or respective owner

Related posts about centos

Related posts about sudo