postmodern / chruby

Changes the current Ruby
MIT License
2.86k stars 190 forks source link

"which gem" shows .rubies/$VER/.. dir but the gems install to .gem/$VER/.. dir ~ confusion #324

Closed ghost closed 9 years ago

ghost commented 9 years ago

When I install new gems, they all go to .gem/ruby/2.2.0/gems/, not to .rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/gems/ . Is how this supposed to work? Now bundle install will take the gems from both dir, often each dir consist different versions of same gems, for example gem list shows test-unit (3.0.9, 3.0.8)

$which ruby

/Users/evo/.rubies/ruby-2.2.0/bin/ruby

$ which gem

/Users/evo/.rubies/ruby-2.2.0/bin/gem

My gem env:

RubyGems Environment:
  - RUBYGEMS VERSION: 2.4.5
  - RUBY VERSION: 2.2.0 (2014-12-25 patchlevel 0) [x86_64-darwin14]
  - INSTALLATION DIRECTORY: /Users/evo/.gem/ruby/2.2.0
  - RUBY EXECUTABLE: /Users/evo/.rubies/ruby-2.2.0/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/evo/.gem/ruby/2.2.0/bin
  - SPEC CACHE DIRECTORY: /Users/evo/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Users/evo/.rubies/ruby-2.2.0/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-14
  - GEM PATHS:
     - /Users/evo/.gem/ruby/2.2.0
     - /Users/evo/.rubies/ruby-2.2.0/lib/ruby/gems/2.2.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "install" => "--no-document"
     - "update" => "--no-document"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/heroku/bin
     - /Users/evo/.gem/ruby/2.2.0/bin
     - /Users/evo/.rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/bin
     - /Users/evo/.rubies/ruby-2.2.0/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /opt/X11/bin
     - /usr/local/git/bin
     - /usr/bin
     - /usr/sbin
     - /bin
     - /sbin
     - /usr/local/bin
     - /usr/local/mysql/bin
postmodern commented 9 years ago

Yep, this is the intended behavior. Gems and rubies should be separated. If you use chruby as root, gems will be installed into the rubygems directory within /path/to/ruby/lib/ruby/gems/....