如何配置已安装的 Ruby 和 gems?

如何配置已安装的 Ruby 和 gems?

我目前的gem env回报:

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/

如何/home/USERNAME/在不卸载的情况下将路径更改为我自己的路径?操作系统:Debian Linux

答案1

.gemrc在您的主路径中创建文件。输入以下几行:

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

有关 gem 配置文件的文档

答案2

如果我误解了这个问题,我很抱歉,但你能不能不要这样做:

export GEM_PATH=/home/myown

也许把它放在你的.bashrc 中。

相关内容