Installing RubyGems as non-root user on MacOS X

Discussion in 'Ruby' started by Jose Marques, Apr 21, 2005.

  1. Jose Marques

    Jose Marques Guest

    I'm trying to install RubyGems on MacOS 10.3.9 in my home directory as a
    non-root/non-admin user. I have Ruby 1.8.2 installed via DarwinPorts and
    Ruby 1.8.2 is in my PATH ahead of the system ruby.

    I am installing RubyGems 0.8.10 from source (not using DarwinPorts) as
    follows.

    $ ruby setup.rb config --prefix=/Users/jose/
    $ ruby setup.rb setup
    $ ruby setup.rb install

    taken from the RubyGems manual[1]. The first two commands complete
    without error but the final command fails with the following:

    hook /Users/jose/Projects/Ruby/rubygems-0.8.10/./post-install.rb failed:
    You don't have write permissions into the /opt/local/lib/ruby/gems/1.8
    directory.
    Try 'ruby setup.rb --help' for detailed usage.

    I've googled a bit for this but so far have not found any fixes. How do I
    stop rubygems from trying to modify my main ruby setup. I would like
    Rubygems to be contained entirely within my home directory. Is that
    possible? Do I need to build my own private copy of Ruby as well?

    Many thanks for and advice.

    [1]: http://docs.rubygems.org/read/chapter/3#page70

    --
    Jose Marques
    Jose Marques, Apr 21, 2005
    #1
    1. Advertising

  2. Jose Marques

    Jose Marques Guest

    On Thu, 21 Apr 2005, Jose Marques wrote:

    > Do I need to build my own private copy of Ruby as well?


    That did the trick. Only downside seems to be that readline support
    doesn't work in irb but that's not a big problem.

    --
    Jose Marques
    Jose Marques, Apr 21, 2005
    #2
    1. Advertising

  3. Jose Marques

    Zach Dennis Guest

    Jose Marques wrote:
    > On Thu, 21 Apr 2005, Jose Marques wrote:
    >
    >> Do I need to build my own private copy of Ruby as well?

    >
    >
    > That did the trick. Only downside seems to be that readline support
    > doesn't work in irb but that's not a big problem.
    >


    Yeah, I can't get readline support to work in irb on my Mac either. If
    anyone knows please let us know....

    Zach
    Zach Dennis, Apr 21, 2005
    #3
  4. Jose Marques

    Jose Marques Guest

    On Thu, 21 Apr 2005, Zach Dennis wrote:

    > Yeah, I can't get readline support to work in irb on my Mac either. If
    > anyone knows please let us know....


    This may not be the best way but I used the following script to build my
    private copy of ruby _with_ readline support. Looking at the log file in
    the readline ext directory it seems it wasn't picking up my LDFLAGS
    settings. The readline library was already installed in /opt/local using
    DarwinPorts.

    -8<- cut here ----
    #!/bin/sh

    PREFIX=${HOME}/tools
    export PREFIX

    LDFLAGS="-L${PREFIX}/lib -L/opt/local/lib"
    export LDFLAGS
    # For readline support
    DLDFLAGS=${LDFLAGS}
    export DLDFLAGS

    CFLAGS="-I${PREFIX}/include -I/opt/local/include"
    export CFLAGS

    VERSION=1.8.2

    cd ruby-${VERSION}
    ../configure --prefix=${PREFIX}
    make
    make install

    --
    Jose Marques
    Jose Marques, Apr 21, 2005
    #4
    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. jose flanigan
    Replies:
    0
    Views:
    331
    jose flanigan
    Jul 4, 2003
  2. hector
    Replies:
    5
    Views:
    410
    CBFalconer
    Dec 5, 2006
  3. Gavin Kistner
    Replies:
    5
    Views:
    129
    Kevin M
    Jan 22, 2004
  4. Une Bévue
    Replies:
    0
    Views:
    132
    Une Bévue
    Mar 11, 2008
  5. sravi
    Replies:
    9
    Views:
    133
    Joe Smith
    May 24, 2005
Loading...

Share This Page