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

Only use environment variables to select the desired ruby #7

Open
postmodern opened this issue Feb 14, 2014 · 3 comments
Open

Only use environment variables to select the desired ruby #7

postmodern opened this issue Feb 14, 2014 · 3 comments

Comments

@postmodern
Copy link

Specifying the desired ruby in the first argument is not compatible with systems that do not have rubypick installed. Additionally, if the ruby process runs system('ruby',...) it will lose the selected ruby:

$ ruby _jruby_ -S irb
irb(main):001:0> system 'ruby', '-v'
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]
=> true

rubypick should only support using the RUBYPICK env variable.

@voxik
Copy link
Member

voxik commented Feb 14, 2014

I am not sure what is your objection or use case. Could you please elaborate?

@postmodern
Copy link
Author

My objection is a user's choice of ruby via ruby _jruby_ is not persisted by system('ruby',...). Were as RUBYPICK=jruby ruby ... does get persisted, since child processes inherit their parent's environment variables. This leads to confusing / surprising behavior when jruby processes accidentally spawn MRI sub-processes.

@voxik
Copy link
Member

voxik commented Feb 14, 2014

I don't think there is satisfiable solution. If you would run:

$ jruby -S irb
irb(main):001:0> system 'ruby', '-v'
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]

Is this expected? You get what you are asking for.

We could go the other way around, i.e. when specifying the interpreter by parameter, define the environment variable, but somebody could object this approach as well.

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

2 participants