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
Confusion of default ruby version #186
Comments
@eregon Updating to the latest release of chruby (v0.3.6) will fix the |
Indeed, I was using 0.3.5. I think it was useful to have the version with an interactive change, to confirm fuzzy matching worked as expected. But thanks, that is probably less confusing than it was. |
@eregon A convention we've adopted to help distinguish between Rubinius and Ruby is to name Rubies directories by So |
Just an aside, but jruby-launcher might help make the JRuby launch time more bearable (if you're not already using it): |
I see. Unfortunately I cannot just rename the directory (could symlink everything from some other dir though). Yeah, already using jruby-launcher. Maybe some Nailgun / drip could help. |
fuzzy matching doesn't pick the "wrong one." it picks the last one. there is no fair way to choose which match is used; either it's the first && As for which RUBIES element is at what index in the array, well, that's a tough thing to nail down. the initial problem is really that as an alternative, you can populate the array manually without using a glob. as an aside, it should be noted that chruby cannot effectively honor that the RUBIES array has already been populated; instead, you are encouraged to populate it after sourcing |
@eregon if you are hip with the modern crowd, you can use there are other valid solutions as well, but this is impossible to solve in |
Closing. As previously mentioned, with the release of 0.3.6 the |
I would see RUBIES as an input variable (as well as output too here), so I would find logical to set it to a relevant value before the script, let it run, and set it to whatever it likes.
OK, I'll report the remaining issue separately: forced gem location. |
Admittedly this might not be the optimal setup for
chruby
, but I would never expect to be so confused from a simple default version setting (the rest seems great though!).So I get rbx-2.0.0-dev instead of wanted (MRI) 2.0.0-dev (but that is a substring so fuzzy matching picks the wrong one in this case, might be ok, might not, I think exact match should precede fuzzy matching).
And it reports
Using rbx-1.8.7
which is definitely confusing to me (I thought it was MRI system 1.8.7 or so at first sight. I guess this is rbx-2.0.0-dev saying it has a RUBY_VERSION of 1.8.7, definitely not very useful to me I would much prefer the rbx version).Also problematic for multiple versions of 2.0:
But that is unsupported I guess.
About the "Using ..." message I would find it much more useful to be the output of
ruby -v
(or equivalently RUBY_DESCRIPTION). That is usually a bit long, an alternative could be: "$ENGINE $ENGINEVERSION ($RUBYVERSION)" (maybe simply "$ENGINE $RUBYVERSION" for MRI):jruby 1.6.7 (1.9.3p392)
,ruby 2.0.0p0
,rbx 2.0.0.rc1 (1.9.3)
.I personally sometimes like to not have my GEM_PATH/GEM_HOME altered (OTOH it is useful to reuse gems in an upgraded compatible version), especially on custom built/dev installations (so multiple versions of 2.0.0 can be supported with no gem inference), yet having gem binaries in PATH (the directory could be created from the proposed version string above and no conflict would occur).
Nitpicking but I do not like much the two calls to
find
at the top of the script, I'd much prefer it did not look anywhere else if I supply $RUBIES.My final remark is about the time it takes to switch to jruby (due to evaluation of a little ruby script). I agree the little script is a good way to ensure everything is right and not set anything blindly, but as chruby is "by shell", doing a couple
chruby jruby
(so all concerned terminals use the desired ruby) might take a while. I guess some caching could be useful here but it would obviously complicate significantly the logic (is there some plugin or so for that you are aware of?).Sorry for the big first impression dump, but I would like to discuss on this and see what can be solved. I tried chruby a couple months ago and had a very similar impression (therefore decided to retry a couple after that is today).
The text was updated successfully, but these errors were encountered: