postmodern / chruby

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

rubinius root installed gems are not in root PATH with rubinius #312

Closed grimm26 closed 9 years ago

grimm26 commented 9 years ago

Using chruby, root cannot see system (root) installed gem bins using rubinius. Rubinius places gem binstubs into /opt/rubies/rubinius-x.x.x/gems/bin and not into /opt/rubies/rubinius-x.x.x/bin.

# chruby rubinius-2.4.1
# ruby -v
rubinius 2.4.1 (2.1.0 b332f133 2014-12-04 3.3 JI) [x86_64-linux-gnu]
# echo $PATH
/opt/rubies/rubinius-2.4.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.3:/usr/lib64/subversion/bin
# gem install bundler
Fetching: bundler-1.7.10.gem (100%)
Successfully installed bundler-1.7.10
Parsing documentation for bundler-1.7.10
Installing ri documentation for bundler-1.7.10
# bundle
-su: bundle: command not found
# ls /opt/rubies/rubinius-2.4.1/bin
erb  gem  irb  rake  rbx  rdoc  ri  ruby  testrb
# ls /opt/rubies/rubinius-2.4.1/gems/bin/
bundle  bundler  irb  racc  racc2y  rake  rdoc  ri  y2racc
#
postmodern commented 9 years ago

Could you run scripts/bug_report.sh? I am curious what $GEM_HOME and $GEM_PATH are.

postmodern commented 9 years ago

Oh I think I see the problem. You are running chruby as root, which does not add $GEM_ROOT/bin to $PATH. This could be changed to better accommodate root users.

grimm26 commented 9 years ago

Yes, the problem occurs when running as root.