rbenv not playing nice with 'screen'? #366

Closed
ghost opened this Issue Mar 21, 2013 · 2 comments

Comments

Projects
None yet
1 participant
@ghost

ghost commented Mar 21, 2013

Hi, I am seeing some issues when using rbenv in a screen session. I have screen setup so that my .bash_profile is sourced, and it does in the last line: eval "$(rbenv init -)".

However, when I'm in a screen session, rbenv doesn't seem to work . Here is a quick example to show what I mean

1st - no screen session

$ rbenv versions
  system
\* 1.9.2-p318 (set by /home/agr/projects/mmetsp/mmetsp-web/.ruby-version)
  1.9.3-p374
  1.9.3-p392
  2.0.0-rc2
$  which ruby
/home/agr/.rbenv/shims/ruby
$ ruby -v
ruby 1.9.2p318 (2012-02-14 revision 34678) [x86_64-linux]
$ which rails
/home/agr/.rbenv/shims/rails

Above is all OK ^^^^

2nd- in a screen session

$ screen -S rbenv-testing
$ cd projects/mmetsp/mmetsp-web/
$ rbenv versions
  system
\* 1.9.2-p318 (set by /home/agr/projects/mmetsp/mmetsp-web/.ruby-version)
  1.9.3-p374
  1.9.3-p392
  2.0.0-rc2
$  which ruby  #  this returns the system ruby, even though there is a local .ruby-version
/sw/ruby/1.9.3-p194/bin/ruby
$ rbenv rehash   
$ which ruby
/sw/ruby/1.9.3-p194/bin/ruby
$ which rails
/sw/ruby/1.9.3-p194/bin/rails

rehash doesn't seem to be doing anything in a screen session and .ruby-version isn't taking effect. Please advise if you know of any workarounds, or if you think this could be an issue with rbenv? Thanks

@mislav

This comment has been minimized.

Show comment
Hide comment
@mislav

mislav Mar 21, 2013

Member

It would be most useful to compre PATH outside, then inside of screen. The problem is either that inside of screen, /sw/ruby/1.9.3-p194/bin/ got pushed to the front of the PATH (overriding rbenv's shims) or because /home/agr/.rbenv/shims is not set up inside of screen. I believe it's the former.

I don't know how to solve it, because I don't see your shell initialization files. For general guidance, refer to the Shell initialization guide

I will close this because it's a bug due to your shell/screen config, not rbenv.

Member

mislav commented Mar 21, 2013

It would be most useful to compre PATH outside, then inside of screen. The problem is either that inside of screen, /sw/ruby/1.9.3-p194/bin/ got pushed to the front of the PATH (overriding rbenv's shims) or because /home/agr/.rbenv/shims is not set up inside of screen. I believe it's the former.

I don't know how to solve it, because I don't see your shell initialization files. For general guidance, refer to the Shell initialization guide

I will close this because it's a bug due to your shell/screen config, not rbenv.

@mislav mislav closed this Mar 21, 2013

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Mar 21, 2013

OK thanks- yes- I think you must be correct it's a PATH issue inside of screen.

ghost commented Mar 21, 2013

OK thanks- yes- I think you must be correct it's a PATH issue inside of screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment