How to change default gems repository on Debian

Discussion in 'Ruby' started by Peter Hoang, Aug 4, 2008.

  1. Peter Hoang

    Peter Hoang Guest

    Hi all,

    I'm trying to upgrade an old gem installation (0.9.5) on Debian machine.
    On Debian, the default gem repository is /var/lib/gems/1.8. However, if
    I install gem from source, the default location of the repository would
    be /usr/lib/ruby/gems/1.8/. I can export GEM_HOME variable to change the
    location however, this will not work for crontab scripts which bypass
    bash_profile and /etc/profile. There are many crontab scripts setup by
    our users and it's quite hard to force everyone to change their scripts.
    Therefore, I need to make sure that the default gem repository is
    /var/lib/gems/1.8. How do I force gem installation to do this instead of
    using /usr/lib/ruby/gems/1.8?

    Thanks.
    --
    Posted via http://www.ruby-forum.com/.
     
    Peter Hoang, Aug 4, 2008
    #1
    1. Advertising

  2. On Monday 04 August 2008 02:09:18 Peter Hoang wrote:

    > I can export GEM_HOME variable to change the
    > location however, this will not work for crontab scripts which bypass
    > .bash_profile and /etc/profile.


    It might be worth trying .bashrc -- .bash_profile is specifically for
    interactive logins -- but that won't work if they're using /bin/sh.

    Another possibility is /etc/environment, though I remember that not working...

    Worst case, there's always setting the environment variable directly
    in /etc/crontab.

    There's also tricks like symlinks, bind-mounts, etc.

    I'm sure Rubygems can be installed wherever you like -- but you really should
    solve the problem of being able to set global environment variables.
     
    David Masover, Aug 4, 2008
    #2
    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. Luke Kenneth Casson Leighton
    Replies:
    0
    Views:
    495
    Luke Kenneth Casson Leighton
    Dec 31, 2008
  2. Ryan Grow
    Replies:
    2
    Views:
    104
    Ryan Grow
    Aug 18, 2006
  3. kazaam
    Replies:
    1
    Views:
    94
    Clifford Heath
    Dec 15, 2007
  4. Replies:
    1
    Views:
    128
  5. Leslie Viljoen

    The Gems Repository Stats

    Leslie Viljoen, May 30, 2008, in forum: Ruby
    Replies:
    3
    Views:
    136
    Eric Hodel
    Jun 5, 2008
Loading...

Share This Page