1

My ~.gemrc looks like:

gem: --user-install --no-ri --no-rdoc
gemhome: /home/me/.gems
gempath:
  - /home/me/.gems

and gem env returns:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.23.2
  - RUBY VERSION: 1.9.3 (2014-05-14 patchlevel 547) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/me/.gems
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /home/me/.gems/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/me/.gems
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--user-install --no-ri --no-rdoc"
     - "gemhome" => "/home/me/.gems"
     - "gempath" => ["/home/me/.gems"]
  - REMOTE SOURCES:
     - http://rubygems.org/

My $PATH is

/home/me/ruby:/home/me/ruby/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

and which ruby returns /home/slackbot/ruby/ruby.

Moreover when I install any gem like gem install bundler it goes to

.gem/ruby/1.9.1/bin/bundle

regardless my 1.9.3 version.

What am I doing wrong to set it up?

Kamil Lelonek
  • 14,592
  • 14
  • 66
  • 90
  • 1
    possible duplicate of [Why are gems installed in a 1.9.1 directory when my Ruby version is different than 1.9.1?](http://stackoverflow.com/questions/6352262/why-are-gems-installed-in-a-1-9-1-directory-when-my-ruby-version-is-different-th) – Holger Just Jul 01 '14 at 10:39
  • But this doesn't solve my problem with `RUBY EXECUTABLE` – Kamil Lelonek Jul 01 '14 at 11:03
  • 1
    The `RUBY EXECUTABLE` shown in the `gem env` output will always be the path of the ruby interpreter which is used to run the `gem env` command (which here might use the first `ruby` executable found in your `PATH`. But it says nothing about your `PATH` or any other system configuration. Generally, it seems you have multiple ruby installations in various places on your system which overlay each other. You should fix that to prevent inconsistencies and strange, hard to debug errors. – Holger Just Jul 01 '14 at 11:11
  • (Also, if you sanitize the shown output and paths, do it consistently everywhere, or preferably, just don't do it as it makes our work helping you much more difficult) – Holger Just Jul 01 '14 at 11:12
  • @HolgerJust, many thanks for comprehensive explanation! What if I want to have different ruby per user without touching default root ruby? – Kamil Lelonek Jul 01 '14 at 11:14
  • @squixy: Look at [chruby](https://github.com/postmodern/chruby). – simonwo Jul 02 '14 at 12:59

0 Answers0