[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Rubygems

Joel Dezenzio

6/2/2009 1:03:00 PM

I have a curious question...

My normal install is C:\Ruby and C:\Ruby\bin is located in my windows
path.

If I do ruby -v (correct version shows)
If I do gem -v (correct version shows)
If I do gem list (correct list shows)

If I rename that folder to C:\Ruby.backup (to store as a backup folder)
the following applies if I go into the C:\Ruby.backup\bin and perform
the following:

If I do ruby -v (correct version shows)
If I do gem -v (it shows 3 versions less 1.3.1 instead of 1.3.4)
If I do gem list (it says its empty)

I just want to know why it does this...
--
Posted via http://www.ruby-....

13 Answers

Joel Dezenzio

6/2/2009 1:09:00 PM

0

I think I might have figured out my own answer, possibly. In case this
is the wrong answer please post your own reply. But, I think the reason
why this is happening is because..

C:\Ruby\bin is in my windows path..

So even though I'm going into the C:\Ruby.backup\bin and performing gem
-v, it is looking in the C:\Ruby\bin path first and not the current
folder I'm in. I'm assuming it's probably a windows order preference
with path variables taking precedence over current location.

--
Posted via http://www.ruby-....

lolveley

6/2/2009 1:24:00 PM

0

unsubscribe





___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail...


Roger Pack

6/2/2009 3:20:00 PM

0

> C:\Ruby\bin is in my windows path..
>
> So even though I'm going into the C:\Ruby.backup\bin and performing gem
> -v, it is looking in the C:\Ruby\bin path first and not the current
> folder I'm in. I'm assuming it's probably a windows order preference
> with path variables taking precedence over current location.

Interesting. For me if I have ruby's in different locations but I cd
into the bin directory, gem -v, gem list report the gems for that
directory (i.e. it doesn't work as yours does for some reason).

-=r
--
Posted via http://www.ruby-....

Joel Dezenzio

6/2/2009 3:43:00 PM

0

Roger Pack wrote:
>> C:\Ruby\bin is in my windows path..
>>
>> So even though I'm going into the C:\Ruby.backup\bin and performing gem
>> -v, it is looking in the C:\Ruby\bin path first and not the current
>> folder I'm in. I'm assuming it's probably a windows order preference
>> with path variables taking precedence over current location.
>
> Interesting. For me if I have ruby's in different locations but I cd
> into the bin directory, gem -v, gem list report the gems for that
> directory (i.e. it doesn't work as yours does for some reason).
>
> -=r

Yeah, it was strange but I can confirm that the behavior did in fact
occur with Vista.. go figure. :)

It also explains why sometimes I would have strange behavior when
running Rubygems with some of my apps.

--
Posted via http://www.ruby-....

Luis Lavena

6/2/2009 9:31:00 PM

0

On Jun 2, 10:09 am, "J. D." <jdezen...@gmail.com> wrote:
> I think I might have figured out my own answer, possibly.  In case this
> is the wrong answer please post your own reply.  But, I think the reason
> why this is happening is because..
>
> C:\Ruby\bin is in my windows path..
>
> So even though I'm going into the C:\Ruby.backup\bin and performing gem
> -v, it is looking in the C:\Ruby\bin path first and not the current
> folder I'm in.  I'm assuming it's probably a windows order preference
> with path variables taking precedence over current location.
>

RubyGems gem commands and Ruby ones are using @"ruby" to refer to the
executable.

So if there is a C:\Ruby\bin in the PATH (and is not your backup one),
will be used.

Also, it will try find "ruby" in the current directory and THEN in the
PATH.

Can you paste the output of "gem env" in both cases?

Thank you.
--
Luis Lavena

Joel Dezenzio

6/2/2009 9:53:00 PM

0

Luis Lavena wrote:
> On Jun 2, 10:09�am, "J. D." <jdezen...@gmail.com> wrote:
>>
> RubyGems gem commands and Ruby ones are using @"ruby" to refer to the
> executable.
>
> So if there is a C:\Ruby\bin in the PATH (and is not your backup one),
> will be used.
>
> Also, it will try find "ruby" in the current directory and THEN in the
> PATH.
>
> Can you paste the output of "gem env" in both cases?
>
> Thank you.

Hi Luis,

I tested with 3 different installations and you are correct. It listed
the gem sources properly for each of those folders.

When I confirmed the original earlier it happened while I was running
QSetup (a program installer) which housed a complete compiled version of
my 1.9.1 installation. I was testing whether or not the program
installer for my version would function properly. As it contains the
devkit and a lot of rubygems it was a huge undertaking. I completely
forgot that I was running the installer file and that it was copying
source into the C:\Ruby\bin folder. Therefore the gems had not finished
compiling and so it showed version 1.3.1. Once the installer completed,
the correct version was listed 1.3.4 and all gems showed up under the
list.

I cannot duplicate the issue I had earlier so I can only assume that it
had something to do with the additional installer running behind the
scenes.

All is well and I appreciate both of you responding to this. I just
wanted to make sure I understood how the processes were supposed to
work. You confirmed it for me nicely.

My thanks.

--
Posted via http://www.ruby-....

Joel Dezenzio

6/2/2009 10:02:00 PM

0

In addition,

I have created a full one-click installer for windows that contains:

Ruby 1.9.1-p129 (ming compiled)
Gem 1.3.4
Rails 2.3.2 and all dependencies
MySql (compiled from binaries)
Sqlite3 (compiled from binaries)
Devkit
.

I'm not sure if anyone could use it or would want to host it. It's an
installer.exe through QSetup and updates path variables for the install
location as well as associates .rb to ruby.

--
Posted via http://www.ruby-....

Eric Hodel

6/2/2009 10:07:00 PM

0

On Jun 2, 2009, at 06:03, J. D. wrote:

> I have a curious question...
>
> My normal install is C:\Ruby and C:\Ruby\bin is located in my windows
> path.
>
> If I do ruby -v (correct version shows)
> If I do gem -v (correct version shows)
> If I do gem list (correct list shows)
>
> If I rename that folder to C:\Ruby.backup (to store as a backup
> folder)

Do not do this, it breaks ruby.

Ruby software (including RubyGems) use rbconfig.rb to figure out where
ruby lives so it can do things like call back into ruby correctly,
find other software, etc.

If you're going to make a backup use real backup software or create an
archive of your ruby directory.

> the following applies if I go into the C:\Ruby.backup\bin and perform
> the following:
>
> If I do ruby -v (correct version shows)
> If I do gem -v (it shows 3 versions less 1.3.1 instead of 1.3.4)
> If I do gem list (it says its empty)
>
> I just want to know why it does this...


Joel Dezenzio

6/2/2009 10:47:00 PM

0

Eric Hodel wrote:
> On Jun 2, 2009, at 06:03, J. D. wrote:
>
>> folder)
> Do not do this, it breaks ruby.
>
> Ruby software (including RubyGems) use rbconfig.rb to figure out where
> ruby lives so it can do things like call back into ruby correctly,
> find other software, etc.
>
> If you're going to make a backup use real backup software or create an
> archive of your ruby directory.

Hi Eric,

I'm not sure I follow you are maybe you are misunderstanding me. There
is no issue. Luis helped me understand how to determine the gem
environment and explained the path.

When I make a backup of any ruby installation (I keep 3 currently), I
keep them in the root directory and just append a date or backup to
them. There's nothing wrong with doing this.

Whichever Ruby version I want to use remains in the same location and
same directory structure..

Example:

I have currently:

C:\Ruby (primary install and version I am using)
C:\Ruby_1.8.7 (backup version of 1.8.7 install)
C:\Ruby.backup (primary backup of the current version I am using)

If I decide to use Ruby 1.8.7, I rename my primary install folder
Ruby.OLD or whatever folder name I decide to use. Nothing has been
tampered with here. No moving of locations or inner movings of anything
within the base directory.

I then rename Ruby_1.8.7 back to Ruby and am able to use Ruby 187 as my
primary install.

All 3 installations work 100% with no issues. I have no problems doing
it this way. My path is set to C:\Ruby\bin so C:\Ruby is my primary
installation folder.

So, again, maybe I'm misunderstanding what you are saying here. Again,
I have no issues..

--
Posted via http://www.ruby-....

Luis Lavena

6/3/2009 12:37:00 AM

0

On Jun 2, 7:06 pm, Eric Hodel <drbr...@segment7.net> wrote:
> On Jun 2, 2009, at 06:03, J. D. wrote:
>
> > I have a curious question...
>
> > My normal install is C:\Ruby and C:\Ruby\bin is located in my windows
> > path.
>
> > If I do ruby -v (correct version shows)
> > If I do gem -v (correct version shows)
> > If I do gem list (correct list shows)
>
> > If I rename that folder to C:\Ruby.backup (to store as a backup  
> > folder)
>
> Do not do this, it breaks ruby.
>
> Ruby software (including RubyGems) use rbconfig.rb to figure out where  
> ruby lives so it can do things like call back into ruby correctly,  
> find other software, etc.
>

Hello Eric.

Actually, Ruby on Windows is more dynamic and accepts relocation.

That's how I've managed to build the exact same version of Ruby in a
sandboxed directory and properly relocate it during installation to C:
\Ruby.

This is done with a trick to rbconfig that removes the hardcoded PATH.

http://github.com/oneclick/rubyinstaller/blob/master/recipes/interpreter/ruby18.rak...

--
Luis Lavena