# Problem installing ruby in linux virtual machine

**URL:** <https://www.ruby-forum.com/t/problem-installing-ruby-in-linux-virtual-machine/119965>\
**Category:** Ruby\
**Created:** [November 12, 2007, 3:58pm UTC](https://www.ruby-forum.com/t/problem-installing-ruby-in-linux-virtual-machine/119965 "2007-11-12T15:58:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [November 12, 2007, 3:58pm UTC](https://www.ruby-forum.com/t/problem-installing-ruby-in-linux-virtual-machine/119965/1 "2007-11-12T15:58:43Z")

</div>

I’m running a linux virtual machine on my windows pc, and am trying to  
install ruby. i’ve used apt-get, like so:

apt-Â­get install ruby ri rdoc mysqlÂ­server libmysqlÂ­ruby

now, ruby is _there_ but not installed. ie

whereis ruby  
=\> ruby: /usr/bin/ruby /usr/lib/ruby /usr/share/man/man1/ruby.1.gz

but when i try to use ruby i get:

ruby hello\_world.rb  
=\>The program ‘ruby’ is currently not installed. You can install it  
by  
typing:  
apt-get install ruby

This happens even if i navigate to /usr/bin/ruby first. (btw if i do  
“apt-get install ruby” i’m told it’s already installed).

I’ve tried adding the above folder to my path as follows:

in ~/.bashrc

export PATH=/usr/bin/ruby:.:$PATH

Can anyone see what i’ve done wrong? Could this be because it’s in a  
virtual machine? (i don’t see why but i’m new to this stuff)

thanks  
max

---

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [November 12, 2007, 6:17pm UTC](https://www.ruby-forum.com/t/problem-installing-ruby-in-linux-virtual-machine/119965/2 "2007-11-12T18:17:42Z")

</div>

Max W. wrote:

> but when i try to use ruby i get:  
> I’ve tried adding the above folder to my path as follows:

Did you try specifying the whole path to Ruby? In other words:

/usr/bin/ruby hello\_world.rb

You might also try

which ruby

and see if that returns the right path.  
I also believe you need to specify the path in .bashrc, not the file:

export PATH=/usr/bin/:$PATH

Although /usr/bin should bin in your path already. Can you run other  
programs from there?  
Is /usr/bin/ruby set to be executable?

-Justin

---

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [November 12, 2007, 6:42pm UTC](https://www.ruby-forum.com/t/problem-installing-ruby-in-linux-virtual-machine/119965/3 "2007-11-12T18:42:43Z")

</div>

Justin C. wrote:

> Although /usr/bin should bin in your path already. Can you run other  
> programs from there?  
> Is /usr/bin/ruby set to be executable?
> 
> -Justin

This helped me find the problem, thanks - it was that i’d switched users  
to root and didn’t realise that root had it’s own version of .bashrc. I  
think i might have made a mistake by installing ruby into one of my home  
folders, but once i pointed root’s and the user’s .bashrc at the install  
directory i was fine.

(new to linux, still finding my feet)  
thanks  
max
