Question: I''ve noticed currently with gem.bat files [1]: It doesn''t play always nicely with windows and different versions of ruby. 1) a contrived example, but if you have a ruby.exe in your path , say c:\ruby_path and run c:\other_ruby\gem.bat from the c:\ directory, it uses c:\ruby_path\ruby.exe to run it 2) you cannot copy gem.bat file anywhere and run it--it must remain where it is [I don''t think this limitation on Linux]. Do you think I should report these or are they too obscure to care about? Thanks! -=r [1] example: @ECHO OFF IF NOT "%~f0" == "~f0" GOTO :WinNT @"ruby.exe" "c:/ruby18/bin/gem" %1 %2 %3 %4 %5 %6 %7 %8 %9 GOTO :EOF :WinNT @"ruby.exe" "%~dpn0" %*
On Wed, Jan 28, 2009 at 5:51 PM, Roger Pack <rogerpack2005 at gmail.com> wrote:> Question: >Hey Roger, sorry took me some time to get back to you.> I''ve noticed currently with gem.bat files [1]: > It doesn''t play always nicely with windows and different versions of ruby.Let''s see...> 1) a contrived example, but if you have a ruby.exe in your path , say > c:\ruby_path and run c:\other_ruby\gem.bat from the c:\ directory, it > uses c:\ruby_path\ruby.exe to run itPreviously the batch files contained the location path of the ruby in usage. That functionality was removed since affected gem installation and future relocation of your Ruby folder. It assumes gem.bat will use "ruby.exe" and look for the ruby-script with the same name of this batch file (dpn0 is used for that). Since the batch and scripts can reside outside ruby bindir, there is no way for us to know if ruby.exe is over there (not without creating lot of batchfile logic).> 2) you cannot copy gem.bat file anywhere and run it--it must remain > where it is [I don''t think this limitation on Linux].Is not, since the gem script in linux contains the shebang that tells you where it should find the ruby interpreter, sometimes is just /bin/env ruby, sometimes is the direct ruby path. For you to use other interpreter with that script need to force the interpreter (ruby19 /path/my/1.8/gem)> Do you think I should report these or are they too obscure to care about?Are too obscure and contains lot cruft that I personally will like to avoid. Being one of those having two interpreters in the path at the same time (with the exact same name).> Thanks! > -=r > > [1] example: > > @ECHO OFF > IF NOT "%~f0" == "~f0" GOTO :WinNT > @"ruby.exe" "c:/ruby18/bin/gem" %1 %2 %3 %4 %5 %6 %7 %8 %9 > GOTO :EOF > :WinNT > @"ruby.exe" "%~dpn0" %* > _______________________________________________ > Rubyinstaller-devel mailing list > Rubyinstaller-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubyinstaller-devel >-- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry
> Are too obscure and contains lot cruft that I personally will like to > avoid. Being one of those having two interpreters in the path at the > same time (with the exact same name).So you''re saying just leave it be, is that right? The only functionality I''m losing currently is that is c:\ruby18\bin is in the path, I can''t run c:\ruby187\bin\gem.bat without taking it out of the path first. I guess you may have a point though--how many people are going to have more than one version of ruby installed and be using both simultaneously? Then again maybe people would do that with 1.8.6 and 1.9, so they can go back and forth between the two, so it could crop up. Thoughts? Thanks! =-r
On Sat, Jan 31, 2009 at 6:05 PM, Roger Pack <rogerpack2005 at gmail.com> wrote:>> Are too obscure and contains lot cruft that I personally will like to >> avoid. Being one of those having two interpreters in the path at the >> same time (with the exact same name). > > So you''re saying just leave it be, is that right?Kind of?> The only functionality I''m losing currently is that is c:\ruby18\bin > is in the path, I can''t run > c:\ruby187\bin\gem.bat > without taking it out of the path first.The problem is not that, the problem is this: Ruby 1.8: C:\Ruby\bin Ruby 1.9: C:\Ruby\bin GEM_PATH=C:\Gems GEM_HOME=C:\Gems PATH=C:\Ruby\bin;%PATH%;C:\Gems\bin So I have installed over there almost all the gems, switch from one ruby to other is just as simple as cleanup the PATH. Cleanup all the PATH from all the installed batch files is more problematic.> I guess you may have a point though--how many people are going to have > more than one version of ruby installed and be using both > simultaneously?I should finish up mrb.exe, is a standalone application that let you alter the path between multiple ruby installations and share the installed gems, It uses some Win32 trickery like Thread Injection, but that''s for other post :-P> Then again maybe people would do that with 1.8.6 and 1.9, so they can > go back and forth between the two, so it could crop up. >This issue was raised in mongrel and rubygems mailing list, and this was our solution, there is no easy way to find, without require all the hacking to find where ruby is installed.> Thoughts? > Thanks!I''m sorry that we cannot please everybody, this was our best alternative for this situation, but of course, there are drawbacks. If you find something that work under all these scenarios, I believe RubyGems and RubyInstaller will be the best place to test those :-) Regards, -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry
On 31/01/2009, Roger Pack <rogerpack2005 at gmail.com> wrote:> > Are too obscure and contains lot cruft that I personally will like to > > avoid. Being one of those having two interpreters in the path at the > > same time (with the exact same name). > > > So you''re saying just leave it be, is that right? > The only functionality I''m losing currently is that is c:\ruby18\bin > is in the path, I can''t run > c:\ruby187\bin\gem.bat > without taking it out of the path first. > I guess you may have a point though--how many people are going to have > more than one version of ruby installed and be using both > simultaneously? > Then again maybe people would do that with 1.8.6 and 1.9, so they can > go back and forth between the two, so it could crop up. >People also expect they can move the ruby folder and it will still work, or at least they might. So hardcoding the path may fix one obscure case and break one less obscure one. If you are concerned about running the right ruby do what distributions do - compile with executable suffix. Then you do not have to switch. THe in terpreters are named didfferentlyIf that did not work that would indeed be a problem with ruby. Thanks Michal
> People also expect they can move the ruby folder and it will still > work, or at least they might.I expected that, but I was under the assumption that if you move ruby''s root folder, rbconfig.rb doesn''t change so it confuses your paths [?]> If you are concerned about running the right ruby do what > distributions do - compile with executable suffix. Then you do not > have to switch. THe in terpreters are named didfferentlyIf that did > not work that would indeed be a problem with ruby.Yeah that would work. -=r
On 31/01/2009, Roger Pack <rogerpack2005 at gmail.com> wrote:> > People also expect they can move the ruby folder and it will still > > work, or at least they might. > > > I expected that, but I was under the assumption that if you move > ruby''s root folder, rbconfig.rb doesn''t change so it confuses your > paths [?] >Maybe it does not have a fixed path on Windows? I would have to look at it but it''s certainly doable, and moving ruby dirs works for me. Thanks Michal
> Ruby 1.8: > C:\Ruby\bin > > Ruby 1.9: > C:\Ruby\binI suppose it is a tricky situation and hard to please everyone. One possibility would be to have rubygems use ~/.gems_ruby_version_number so that there isn''t a conflict within the /bin directories [?] -=r
oh wow. You are indeed right. For some reason I had run into the problem in years past so thought it was still there but it appears to not be. Not sure It does save the prefix: CONFIG["prefix"] = (TOPDIR || DESTDIR + "") but I''d imagine that doesn''t matter. -- unless extensions use that [?] [maybe more important in linux?] Anyway nice to know. -=r On Sat, Jan 31, 2009 at 2:53 PM, Michal Suchanek <hramrach at centrum.cz> wrote:> On 31/01/2009, Roger Pack <rogerpack2005 at gmail.com> wrote: >> > People also expect they can move the ruby folder and it will still >> > work, or at least they might. >> >> >> I expected that, but I was under the assumption that if you move >> ruby''s root folder, rbconfig.rb doesn''t change so it confuses your >> paths [?] >> > > Maybe it does not have a fixed path on Windows? > > I would have to look at it but it''s certainly doable, and moving ruby > dirs works for me. > > Thanks > > Michal > _______________________________________________ > Rubyinstaller-devel mailing list > Rubyinstaller-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubyinstaller-devel >-- I wonder if the phrase "meeting my needs in the relationship" has a hint of selfishness...
FWIW, MS Visual Studio installs a bunch of CLI tools, but does not add them to your path. Instead, they provide cmd/bat files that set a bunch of environment variables and mess with the path before dumping you to a command prompt. That way, you get a little sandbox; the env vars and path alterations apply only to that command session. You might want to look at that approach; one cmd file to launch 1.8.6, one for 1.8.7, etc. Sent from my iPod On Jan 31, 2009, at 3:05 PM, Roger Pack <rogerpack2005 at gmail.com> wrote:>> Are too obscure and contains lot cruft that I personally will like to >> avoid. Being one of those having two interpreters in the path at the >> same time (with the exact same name). > > So you''re saying just leave it be, is that right? > The only functionality I''m losing currently is that is c:\ruby18\bin > is in the path, I can''t run > c:\ruby187\bin\gem.bat > without taking it out of the path first. > I guess you may have a point though--how many people are going to have > more than one version of ruby installed and be using both > simultaneously? > Then again maybe people would do that with 1.8.6 and 1.9, so they can > go back and forth between the two, so it could crop up. > > Thoughts? > Thanks! > > =-r > _______________________________________________ > Rubyinstaller-devel mailing list > Rubyinstaller-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubyinstaller-devel >