Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in terminal opened inside rvm project, cding out uses system ruby instead of rvm default #2531

Closed
ethco opened this issue Jan 9, 2014 · 32 comments
Milestone

Comments

@ethco
Copy link

ethco commented Jan 9, 2014

this one is weird.

  • open a new terminal tab in a rvm-enabled project (for me, ~/oauthr)
    • rvm correctly uses the ruby for that project
  • cd out of the project into a non-rvm directory
    • rvm switches to the system ruby instead of the default ruby configured for rvm

this continues if I then cd back into any rvm project (switches to the project's ruby) and then back out to any non-rvm directory (uses system ruby instead of rvm default ruby)

this doesn't happen when the terminal is initially opened outside of an rvm-enabled project - it correctly uses the rvm default ruby, switches correctly when cding into a rvm project, and switches back to the rvm default ruby when cding back out.

@mpapis mpapis closed this as completed in 0b72c17 Jan 9, 2014
@mpapis
Copy link
Member

mpapis commented Jan 9, 2014

this should do it, please let me know if it does not

@ethco
Copy link
Author

ethco commented Jan 9, 2014

yup, that got it. thanks.

@ethco
Copy link
Author

ethco commented Jan 9, 2014

... however, this seems to have reverted the effects of the fix for #2519. now when I open a new tab inside a rvm project, the rvm default ruby is used instead of the project's ruby. (gemset is set correctly though)

@mpapis
Copy link
Member

mpapis commented Jan 10, 2014

has to be a bug, I will investigate

@mpapis
Copy link
Member

mpapis commented Jan 11, 2014

the above should improve things, I have also added extra test - but it works (compared to the other failing one which seams to be related to this problem) ... can someone retest it after rvm get head

@hiattp
Copy link

hiattp commented Jan 11, 2014

Didn't fix the problem I was having on #2527

@ethco
Copy link
Author

ethco commented Jan 11, 2014

no, I still have the same behavior as #2519 (not the behavior described actually in this issue)

@mpapis
Copy link
Member

mpapis commented Jan 11, 2014

yeah, I know there is something, I just can not find a test that will reproduce it and tell me what is wrong

@mpapis
Copy link
Member

mpapis commented Jan 12, 2014

added more tests and a small fix, please give it a go after rvm get head

@mpapis
Copy link
Member

mpapis commented Jan 12, 2014

ok so I have finally reproduced the problem on travis, I can not reproduce it locally, but maybe I can debug it on travis, it will take some time, but it's progress

@mpapis
Copy link
Member

mpapis commented Jan 12, 2014

hmm, so the test passes after removing rvm_project_rvmrc=0 from ~/.rvmrc - are you using the cd function wrapper or is it disabled like it is by default on travis?

mpapis added a commit to rvm/rvm-test that referenced this issue Jan 12, 2014
@mpapis
Copy link
Member

mpapis commented Jan 12, 2014

ok so I have added tests simulating the problem and none of them fails right now, I had to do one change to make the tests work - it could be the one that will make it work for you, please test again after rvm get head.

@hiattp
Copy link

hiattp commented Jan 12, 2014

Still no luck unfortunately :/

@mpapis
Copy link
Member

mpapis commented Jan 12, 2014

please download this two files (click on the raw link):

and then run:

gem install tf
tf --text load_ruby-version_comment_test.sh rvm_project_rvmrc_comment_test.sh

gist the output

@hiattp
Copy link

hiattp commented Jan 13, 2014

Here is the gist. Thanks to the test I discovered that everything works fine so long as I don't have a default ruby set, so rvm alias delete default is a temporary fix.

@mpapis
Copy link
Member

mpapis commented Jan 13, 2014

this is interesting all the tests pass, the load_ruby-version_comment_test.sh is specifically designed to simulate your problem and it passes, can you review it and maybe suggest extra steps to simulate your setup? maybe you set default ruby using PATH before sourcing rvm?

@hiattp
Copy link

hiattp commented Jan 13, 2014

I'll poke around but it sounds like it's pretty idiosyncratic to my setup so I must just have something weird somewhere, not a big deal

@mpapis
Copy link
Member

mpapis commented Jan 13, 2014

actually I was getting this report for some time, but I can not reproduce this in tests, as I can not reproduce it - I do not know what to fix.

@ethco
Copy link
Author

ethco commented Jan 14, 2014

gist for me of tf --text load_ruby-version_comment_test.sh rvm_project_rvmrc_comment_test.sh : https://gist.github.com/ethco/6ac6964160491ec6e760

@mpapis
Copy link
Member

mpapis commented Jan 14, 2014

@ethco oh it looks like you can reproduce the problem! please confirm you get the same after:

rvm get head
rvm reload

@ethco
Copy link
Author

ethco commented Jan 14, 2014

one fewer failure after get head: https://gist.github.com/ethco/6890585e6ddf1f9b9481

@mpapis
Copy link
Member

mpapis commented Jan 14, 2014

@ethco please get this test https://gist.github.com/mpapis/001a76111d9f42a8e1e7 and run it with:

tf --text failing_load_comment_test.sh 2>&1 | tee big.log

please gist big.log file.

@ethco
Copy link
Author

ethco commented Jan 14, 2014

@mpapis
Copy link
Member

mpapis commented Jan 15, 2014

it looks like i found one, please retest after rvm get head ; rvm reload

@elia
Copy link
Contributor

elia commented Jan 15, 2014

works for me 👍

@ethco
Copy link
Author

ethco commented Jan 15, 2014

looks good. behavior seems correct now and the tf tests all pass.

@mpapis
Copy link
Member

mpapis commented Jan 15, 2014

assuming it's all good now, will release new version after reviewing rest of the tickets

@mpapis mpapis closed this as completed Jan 15, 2014
@hiattp
Copy link

hiattp commented Jan 15, 2014

Fixed for me too!

@ethco
Copy link
Author

ethco commented Jan 15, 2014

yay!

@mpapis
Copy link
Member

mpapis commented Jan 15, 2014

and released as 1.25.15

@vipin8169
Copy link

Still getting the same problem with "rvm 1.26.11"
When opening new tab, I've to cd into the directory to make it work
cd ./

@subhash-shah
Copy link

Didn't work for me on Ubuntu 14.04 64-bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants