Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete a gem path?

How can I delete the second path (/home/tom/.gem/ruby/1.8) of GEM PATHS: ?

Here's the output of $ gem env:

RubyGems Environment:

  - RUBYGEMS VERSION: 1.3.5
  - RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]
  - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: /usr/bin/ruby1.8
  - EXECUTABLE DIRECTORY: /usr/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /usr/lib/ruby/gems/1.8
     - /home/tom/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://gems.rubyforge.org/

I appreciate the help!

like image 882
TomDogg Avatar asked Jun 04 '10 14:06

TomDogg


People also ask

How do I remove a gem path?

Just right click on a gem to pull it back out. You can remove them, put them in any other slot of that color. There are serveral video guides on youtube about nearly anything that new players may be asking questions about. This is a short video in my Path of Exile series that explains the skill and gem system.

How do I set gem version in Gemfile?

There are several ways to specify gem versions: Use a specific version: gem "name-of-gem", "1.0" . You can find specific versions on Rubygems.org (provided that's the source you”re using) by searching for your gem and looking at the “Versions” listed. Use a version operator: gem "name-of-gem", ">1.0" .


2 Answers

Override in your ~/.bashrc file?

#in ~/.bashrc
export GEM_PATH=/usr/lib/ruby/gems/1.8

Feels kind of hacky though.

like image 74
Max Williams Avatar answered Sep 18 '22 23:09

Max Williams


You can’t! I also wanted to do it, and haven’t found a way. Then I looked for in RubyGems source (at github.com) and learned that it tries to get the path from etc/gemrc and ~/.gemrc. If it fails (and fails GEM_PATH environment variable too), it assumes ~/.gem to be the default path.

Therefore, Max William is right, and you have either to export GEM_PATH or to create a ~/.gemrc. And it’s not a hack, for sure! :-)

Hope to have cleared things a bit!

like image 36
ijverig Avatar answered Sep 19 '22 23:09

ijverig