From: Paul Lutus Date: 2006-11-26T03:05:08+09:00 Subject: Re: [Mac OS X] having three ruby versions installed Une b辿vue wrote: > Paul Lutus wrote: > >> >> Yes, "no prob at all" except all the problems you just listed. If the >> situation had "no prob at all" you would not have posted, and your >> error-free code would execute without error messages. > > I desagree totally about what you said. You can't disagree that your system isn't working as it should. If that were true, you wouldn't have posted. > The prob, it is clear enough for me now, arroses from Apple's faulty > shell since 2 or 3 years. The "/usr/bin/env" doesn't work correctly this > has nothing to do with the three version i have. Yes, I understand that. So instead of using: /usr/bin/env ruby -w You can instead use: /usr/local/bin/ruby -w On ALL your Ruby scripts, no matter how numerous they become, and then, when you want to change Ruby versions, just change the destination for the symlink located at /usr/local/bin/ruby. That way, no matter how many scripts you have, even if they call each other, and even if they use "system()" and backticks, they will all use the same Ruby version, until you change the symlink again. > I tell you, in case i have a RubyCocoa app to write and send it outside > of my box, in that case i'll have a fourth ruby version in a bundle, > i've done that in the past and that works very-well when you must embed > a ruby in an app. Use a symlink to sort this out, to make all your scripts cooperate on the version of Ruby to use at a particular moment. > Your solution would be to leave only on my box I offered that as an alternative, not a solution. It was meant to show the advantage of the symlink. > the Apple's version of > Ruby, used by MacOS X, afaik, then I can't use it because i can't > install rubygems with this version ; this is good practice to let the OS > version as it is. The solution I offered was to create a symlink located at /usr/local/bin/ruby, and not edit your path, and not use environmental variables and not use aliases. This will allow you to use more than one Ruby version, IF they don't write to each other's library locations. > Then logically i need at least a second version to install any gems i > need, also C ext to ruby i'm writing. No problem ... as long as you use a symlink to get all your scripts to agree on which Ruby to use, and as long as the library issue doesn't come up. > And because i want to use some java libs i need the third one jRuby. Already addressed. Another advantage to the symlink approach is that, if you try: $ ruby -version The result will be consistent, so Ruby version tests will also work as they should, and you can get all your scripts to change Ruby versions instantly, including those that might be launched from a pre-existing shell. BTW what happened to the good code that produced an error message? What was the outcome on that? -- Paul Lutus http://www.arachnoid.com