Problem installing ruby in linux virtual machine

Discussion in 'Ruby' started by Max Williams, Nov 12, 2007.

  1. Max Williams

    Max Williams Guest

    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
    --
    Posted via http://www.ruby-forum.com/.
    Max Williams, Nov 12, 2007
    #1
    1. Advertising

  2. 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
    Justin Collins, Nov 12, 2007
    #2
    1. Advertising

  3. Max Williams

    Max Williams Guest

    Justin Collins 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
    --
    Posted via http://www.ruby-forum.com/.
    Max Williams, Nov 12, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    2,243
  2. M. Edward (Ed) Borasky

    Ruby Virtual Machine Benchmarks?

    M. Edward (Ed) Borasky, Sep 11, 2006, in forum: Ruby
    Replies:
    0
    Views:
    102
    M. Edward (Ed) Borasky
    Sep 11, 2006
  3. Max Williams
    Replies:
    5
    Views:
    171
    Max Williams
    Jan 24, 2008
  4. Andrew Berg
    Replies:
    0
    Views:
    163
    Andrew Berg
    Oct 4, 2012
  5. Dennis Lee Bieber
    Replies:
    0
    Views:
    168
    Dennis Lee Bieber
    Oct 5, 2012
Loading...

Share This Page