Justin Collins
11/12/2007 5:17:00 PM
Max Williams wrote:
> 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
>
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