trouble with gem

670 views
Skip to first unread message

Badal

unread,
Aug 21, 2010, 10:36:11 AM8/21/10
to RubyInstaller
After a fresh install of 1.9.2 p0, in F:/Ruby192, I get

F:\Ruby192\bin>.\gem list

*** LOCAL GEMS ***

minitest (1.6.0)
rake (0.8.7)
rdoc (2.5.8)

F:\Ruby192\bin>.\gem install ap
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory - C:/

This is strange, as there is no C: disk on my machine. This C: must
come from somewhere ....

Any idea ?
_md

Luis Lavena

unread,
Aug 21, 2010, 11:57:57 AM8/21/10
to rubyin...@googlegroups.com

Hello,

When reporting issues related to RubyGems please provide the complete
output of "gem env" command.

Also, why are you invoking .\gem, is not Ruby in your PATH?. Roger
Pack reported issues about that in the past associated with stub
scripts (gem.bat)

Please add to your PATH and try again.
--
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

Badal

unread,
Aug 21, 2010, 2:55:48 PM8/21/10
to RubyInstaller
Luis,
Thanks for your fast answer.

> When reporting issues related to RubyGems please provide the complete
> output of "gem env" command.

RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i386-mingw32]
- INSTALLATION DIRECTORY: F:/Ruby192/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: F:/Ruby192/bin/ruby.exe
- EXECUTABLE DIRECTORY: F:/Ruby192/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- F:/Ruby192/lib/ruby/gems/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/

> Also, why are you invoking .\gem, is not Ruby in your PATH? Roger
> Pack reported issues about that in the past associated with stub
> scripts (gem.bat)

Because, my working environment is still 1.9.1. I want to check my
projects one by one before shifting to 1.9.2.
And, I could not find C: in the bat files.

> Please add to your PATH and try again.
> --

Same error :

F:\Ruby192\bin>path = F:\Ruby192\bin;%path%

F:\Ruby192\bin>gem install ap
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory - C:/

It looks like this C: is hardcoded somewhere ... I have many working
rubies (1.8.6, 1.8.7, 1.9.1 + jruby), none has this error. And I as
wrote in my initial post, my machine has no C: disk.

_md

Luis Lavena

unread,
Aug 21, 2010, 3:06:42 PM8/21/10
to rubyin...@googlegroups.com
On Sat, Aug 21, 2010 at 3:55 PM, Badal <mic...@demazure.com> wrote:
>
> Because, my working environment is still 1.9.1. I want to check my
> projects one by one before shifting to 1.9.2.

Well, you can install RubyInstaller 1.9.2 along with 1.9.1 into
separate directories and not having them in the PATH. You can also use
Pik to switch versions.

> And, I could not find C: in the bat files.
>
>

> F:\Ruby192\bin>path = F:\Ruby192\bin;%path%
>
> F:\Ruby192\bin>gem install ap
> ERROR:  While executing gem ... (Errno::ENOENT)
>    No such file or directory - C:/
>
> It looks like this C: is hardcoded somewhere ... I have many working
> rubies (1.8.6, 1.8.7, 1.9.1 + jruby), none has this error. And I as
> wrote in my initial post, my machine has no C: disk.
>

can you run gem install ap --debug -V ?

Dunno what is invoking C:/ as hardcoded, but Ruby 1.9.2 for sure is
not, at least no reference by gem env which could lead to that.

Badal

unread,
Aug 21, 2010, 3:47:15 PM8/21/10
to RubyInstaller
>
> can you run gem install ap --debug -V ?
>
> Dunno what is invoking C:/ as hardcoded, but Ruby 1.9.2 for sure is
> not, at least no reference by gem env which could lead to that.
>

F:\Ruby192\bin>.\gem install ap --debug -V
Exception `NameError' at F:/Ruby192/lib/ruby/1.9.1/rubygems/
command_manager.rb:1
64 - uninitialized constant Gem::Commands::InstallCommand
Exception `ArgumentError' at F:/Ruby192/lib/ruby/1.9.1/rubygems.rb:497
- non-abs
olute home
Exception `NameError' at F:/Ruby192/lib/ruby/1.9.1/syck/tag.rb:81 -
method `yaml
_as' not defined in Module
Exception `Gem::LoadError' at F:/Ruby192/lib/ruby/1.9.1/rubygems.rb:
762 - Could
not find RubyGem test-unit (>= 0)

Exception `Errno::ENOENT' at F:/Ruby192/lib/ruby/1.9.1/rubygems/
spec_fetcher.rb:
47 - No such file or directory - C:/
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory - C:/
F:/Ruby192/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:47:in
`stat'
F:/Ruby192/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:47:in
`initialize'
F:/Ruby192/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:38:in `new'
F:/Ruby192/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:38:in
`fetcher'
F:/Ruby192/lib/ruby/1.9.1/rubygems/dependency_installer.rb:
108:in `find_
gems_with_sources'
F:/Ruby192/lib/ruby/1.9.1/rubygems/dependency_installer.rb:
205:in `find_
spec_by_name_and_version'
F:/Ruby192/lib/ruby/1.9.1/rubygems/dependency_installer.rb:
237:in `insta
ll'
F:/Ruby192/lib/ruby/1.9.1/rubygems/commands/install_command.rb:
119:in `b
lock in execute'
F:/Ruby192/lib/ruby/1.9.1/rubygems/commands/install_command.rb:
116:in `e
ach'
F:/Ruby192/lib/ruby/1.9.1/rubygems/commands/install_command.rb:
116:in `e
xecute'
F:/Ruby192/lib/ruby/1.9.1/rubygems/command.rb:270:in `invoke'
F:/Ruby192/lib/ruby/1.9.1/rubygems/command_manager.rb:134:in
`process_ar
gs'
F:/Ruby192/lib/ruby/1.9.1/rubygems/command_manager.rb:104:in
`run'
F:/Ruby192/lib/ruby/1.9.1/rubygems/gem_runner.rb:58:in `run'
F:/Ruby192/bin/gem:21:in `<main>'

F:\Ruby192\bin>

Badal

unread,
Aug 21, 2010, 4:01:40 PM8/21/10
to RubyInstaller
>
> Dunno what is invoking C:/ as hardcoded, but Ruby 1.9.2 for sure is
> not, at least no reference by gem env which could lead to that.
>

C: is in rubygems.rb line 500. Strange !

def self.find_home
File.expand_path "~"
rescue
if File::ALT_SEPARATOR then
"C:/"
else
"/"
end
end

Changing this C: in F: works !

Thanks for the tip ! And thanks for the amazing installer !

_md

Luis Lavena

unread,
Aug 21, 2010, 5:57:45 PM8/21/10
to rubyin...@googlegroups.com
On Sat, Aug 21, 2010 at 5:01 PM, Badal <mic...@demazure.com> wrote:
>>
>> Dunno what is invoking C:/ as hardcoded, but Ruby 1.9.2 for sure is
>> not, at least no reference by gem env which could lead to that.
>>
>
> C: is in rubygems.rb line 500. Strange !
>
> def self.find_home
>    File.expand_path "~"
>  rescue
>    if File::ALT_SEPARATOR then
>      "C:/"
>    else
>      "/"
>    end
>  end
>
> Changing this C: in F: works !
>

The issue seems that your system lacks either HOME, HOMEDRIVE +
HOMEPATH or USERPROFILE folders needed by RubyGems.

If you do this in a terminal:

ruby -ve "puts File.expand_path('~')"

What is your output?

Ruby 1.9.2 should handle that properly, and if not, then we need to
take a look to what is the content (set) of the above mentioned
variables.

Please post that and if we see is a problem, we will report back to Ruby-Core.

Thank you.

Badal

unread,
Aug 21, 2010, 7:32:44 PM8/21/10
to RubyInstaller
Luis,

> The issue seems that your system lacks either HOME, HOMEDRIVE +
> HOMEPATH or USERPROFILE folders needed by RubyGems.

Everything is there :

F:\Ruby192\bin>set
....
HOME=\Documents and Settings\Michel
HOMEDRIVE=F:
HOMEPATH=\Documents and Settings\Michel
....
USERNAME=Michel
USERPROFILE=F:\Documents and Settings\Michel
...

> If you do this in a terminal:
>
> ruby -ve "puts File.expand_path('~')"
>
> What is your output?

F:\Ruby192\bin>.\ruby -ve "puts File.expand_path('~')"
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
-e:1:in `expand_path': non-absolute home (ArgumentError)
from -e:1:in `<main>'

> Please post that and if we see is a problem, we will report back to Ruby-Core.
>
That may be necessary

_md

Luis Lavena

unread,
Aug 21, 2010, 7:41:29 PM8/21/10
to rubyin...@googlegroups.com
On Sat, Aug 21, 2010 at 8:32 PM, Badal <mic...@demazure.com> wrote:
> Luis,
>
>> The issue seems that your system lacks either HOME, HOMEDRIVE +
>> HOMEPATH or USERPROFILE folders needed by RubyGems.
>
> Everything is there :
>
> F:\Ruby192\bin>set
> ....
> HOME=\Documents and Settings\Michel
> HOMEDRIVE=F:
> HOMEPATH=\Documents and Settings\Michel
> ....
> USERNAME=Michel
> USERPROFILE=F:\Documents and Settings\Michel
> ...

That might be the problem. How you setup HOME without the HOMEDRIVE?

Normally I setup HOME as:

SET HOME=%HOMEDRIVE%%HOMEPATH%

That is what expects.

Because you don't specified the drive letter, it fails and that is why
RubyGems defaults to C:/

>>
>> ruby -ve "puts File.expand_path('~')"
>>
>> What is your output?
>
> F:\Ruby192\bin>.\ruby -ve "puts File.expand_path('~')"
> ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
> -e:1:in `expand_path': non-absolute home (ArgumentError)
>        from -e:1:in `<main>'
>

See above, removing HOME (set HOME=) will let it resolve properly.

Badal

unread,
Aug 21, 2010, 7:52:46 PM8/21/10
to RubyInstaller
>
> See above, removing HOME (set HOME=) will let it resolve properly.
>
Yes, indeed.
Thanks again.

_md
Reply all
Reply to author
Forward
0 new messages