How to configure installed Ruby and gems?

10,019

Solution 1

Create .gemrc file in your home path. Put these lines:

gemhome: /home/CHANGE_IT_TO_USERNAME/.gems
gempath:
  - /home/CHANGE_IT_TO_USERNAME/.gems

Documentation about gem configuration file

Solution 2

I'm sorry if I've misunderstood the question but can you not just do:

export GEM_PATH=/home/myown

Maybe put it in your .bashrc.

Share:
10,019

Related videos on Youtube

Dan Forbes
Author by

Dan Forbes

Updated on September 17, 2022

Comments

  • Dan Forbes
    Dan Forbes over 1 year

    My current gem env returns:

    RubyGems Environment:
      - RUBYGEMS VERSION: 1.3.6
      - RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
      - INSTALLATION DIRECTORY: /home/USERNAME/.gems
      - RUBYGEMS PREFIX: /home/narkoz
      - RUBY EXECUTABLE: /usr/bin/ruby1.8
      - EXECUTABLE DIRECTORY: /home/USERNAME/.gems/bin
      - RUBYGEMS PLATFORMS:
        - ruby
        - x86_64-linux
      - GEM PATHS:
         - /home/USERNAME/.gems
         - /usr/lib/ruby/gems/1.8
      - GEM CONFIGURATION:
         - :update_sources => true
         - :verbose => true
         - :benchmark => false
         - :backtrace => false
         - :bulk_threshold => 1000
         - "gempath" => ["/home/USERNAME/.gems", "/usr/lib/ruby/gems/1.8"]
         - "gemhome" => "/home/USERNAME/.gems"
      - REMOTE SOURCES:
         - http://rubygems.org/
    

    How can I change path /home/USERNAME/ to my own without uninstalling? OS: Debian Linux

    • Dan Rosenstark
      Dan Rosenstark about 14 years
      Good question +1. I mean, basically anything about ruby gems is a good question, I think :)
  • zoechi
    zoechi about 4 years