Install rubygems on Vista

Hi all,

Sorry if this quesione is posted.

I install one-click Ruby on Vista with default gems. I add ruby
path(c:\ruby\bin;) to the system environment variables. After that I can
check the ruby version from any directory. But I can only check gem
version under c:\ruby\bin. I wonder how I can check gem version from any
directory.

Thanks

Li

On Dec 24, 2:01 pm, Li Chen [email protected]main.invalid wrote:

Hi all,

Sorry if this quesione is posted.

I install one-click Ruby on Vista with default gems. I add ruby
path(c:\ruby\bin;) to the system environment variables. After that I can
check the ruby version from any directory. But I can only check gem
version under c:\ruby\bin. I wonder how I can check gem version from any
directory.

Li,

I don’t own or have a Vista system to recreate your situation, could
you copy the output you get running “gem env” from outside c:\ruby\bin
folder? also, which version of rubygem you’re using will be helpful
too.

Regards,

Luis

On Dec 24, 3:16 pm, Li Chen [email protected] wrote:

Li
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

 - C:/ruby/lib/ruby/gems/1.8

ERROR: Invalid option: --v. See ‘gem --help’.

C:\ruby\bin>gem --version
1.0.1

C:\ruby\bin>

Can you list the contents of c:\ruby\bin\ ?
I’m interested to see if there are other extensions for gem (looking
for .cmd or .bat files) and their contents.

I’m not familiar with the error message you’re getting. could you do
the following steps and copy your output?

=====

D:\Users\Luis>set RUBYOPT
Environment variable RUBYOPT not defined

D:\Users\Luis>SET RUBYOPT=rubygems

D:\Users\Luis>ruby -v
ruby 1.8.5 (2007-09-24 patchlevel 114) [i386-mswin32]

D:\Users\Luis>irb
irb(main):001:0> require ‘rubygems’
=> false

===

Will be handy to know if you have administrative privileges or not
(since UAC is a big pain).

Regards,

Luis

Luis L. wrote:

On Dec 24, 3:16 pm, Li Chen [email protected] wrote:

Can you list the contents of c:\ruby\bin\ ?
12/24/2007 12:16 PM .
12/24/2007 12:16 PM …
12/14/2007 09:51 AM 4,021 erb
12/14/2007 09:51 AM 174 erb.bat
12/14/2007 09:51 AM 25 fxri.bat
12/14/2007 09:51 AM 245 fxri.rbw
12/14/2007 09:51 AM 21,504 gdbm.dll
12/24/2007 12:16 PM 725 gem
12/24/2007 12:16 PM 162 gem.bat
12/21/2007 03:57 PM 27 gemhelp.bat
12/24/2007 12:16 PM 91 gemlock
12/24/2007 12:16 PM 63 gemlock.bat
12/24/2007 12:16 PM 83 gemri
12/24/2007 12:16 PM 55 gemri.bat
12/24/2007 12:16 PM 93 gemwhich
12/24/2007 12:16 PM 65 gemwhich.bat
12/24/2007 12:16 PM 96 gem_mirror
12/24/2007 12:16 PM 68 gem_mirror.bat
12/24/2007 12:16 PM 96 gem_server
12/24/2007 12:16 PM 68 gem_server.bat
12/14/2007 09:43 AM 237,568 glut32.dll
12/14/2007 09:43 AM 28,728 glut32.lib
12/14/2007 09:51 AM 872,448 iconv.dll
12/14/2007 09:51 AM 6,144 iconv.exe
12/24/2007 12:16 PM 117 index_gem_repository.rb
12/24/2007 12:16 PM 89 index_gem_repository.rb.bat
12/14/2007 09:51 AM 98 inputrc.euro
12/14/2007 09:51 AM 398 irb
12/14/2007 09:51 AM 174 irb.bat
12/14/2007 09:33 AM 1,077,248 libeay32.dll
12/14/2007 09:44 AM 147,456 libexpat.dll
12/14/2007 09:44 AM 151,552 libexpatw.dll
12/14/2007 09:50 AM 53,248 libfcgi.dll
10/05/2007 06:49 PM 872,518 msvcrt-ruby18.dll
12/14/2007 09:33 AM 282,624 openssl.exe
12/14/2007 09:51 AM 72,192 pdcurses.dll
12/14/2007 09:48 AM 4,528 proxyserver.rb
12/24/2007 12:22 PM 362 rails
12/24/2007 12:22 PM 167 rails.bat
12/21/2007 04:18 PM 359 rake
12/21/2007 04:18 PM 166 rake.bat
12/14/2007 09:27 AM 70 rake.cmd
12/14/2007 09:51 AM 1,605 rdoc
12/14/2007 09:51 AM 175 rdoc.bat
12/14/2007 09:51 AM 136,192 readline.dll
12/14/2007 09:51 AM 1,536 ri
12/14/2007 09:51 AM 173 ri.bat
10/05/2007 06:49 PM 20,541 ruby.exe
10/05/2007 06:49 PM 20,542 rubyw.exe
12/14/2007 09:48 AM 11,200 sqlsh.rb
12/14/2007 09:33 AM 200,704 ssleay32.dll
12/14/2007 09:51 AM 156 testrb
12/14/2007 09:51 AM 177 testrb.bat
12/24/2007 12:16 PM 675 update_rubygems
12/24/2007 12:16 PM 174 update_rubygems.bat
12/14/2007 09:24 AM 107 update_rubygems.cmd
12/14/2007 09:24 AM 59,904 zlib1.dll
55 File(s) 4,289,776 bytes
2 Dir(s) 93,446,590,464 bytes free

Will be handy to know if you have administrative privileges or not

Since I own this computer I think I have the administrative right to
install any software I want.

C:>irb
irb(main):001:0> require ‘rubygems’
=> false
irb(main):002:0> exit

C:\ruby\bin>irb
irb(main):001:0> require ‘rubygems’
=> false
irb(main):002:0>

Luis L. wrote:
,

I don’t own or have a Vista system to recreate your situation, could
you copy the output you get running “gem env” from outside c:\ruby\bin
folder? also, which version of rubygem you’re using will be helpful
too.

Regards,

Luis

Hi Luis,

Here is what I get from the prompt window.

Thanks,

Li

###############################################

C:\Users\Alex>gem env
:1: no such file to load – rubygems (LoadError)

C:\Users\Alex>ruby --version
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

C:\Users\Alex>ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

C:\Users\Alex>gem --version
:1: no such file to load – rubygems (LoadError)

C:\Users\Alex>cd\

C:>cd ruby\bin

C:\ruby\bin>ruby --version
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

C:\ruby\bin>gem env
RubyGems Environment:

  • RUBYGEMS VERSION: 1.0.1 (1.0.1)
  • RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
  • INSTALLATION DIRECTORY: C:/ruby/lib/ruby/gems/1.8
  • RUBY EXECUTABLE: C:/ruby/bin/ruby.exe
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86-mswin32-60
  • GEM PATHS:
    • C:/ruby/lib/ruby/gems/1.8
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :benchmark => false
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:

C:\ruby\bin>gem --v
ERROR: Invalid option: --v. See ‘gem --help’.

C:\ruby\bin>gem --version
1.0.1

C:\ruby\bin>

##############################

On 24 dic, 16:30, Li Chen [email protected] wrote:

12/14/2007 09:51 AM 245 fxri.rbw
12/14/2007 09:51 AM 21,504 gdbm.dll
12/24/2007 12:16 PM 725 gem
12/24/2007 12:16 PM 162 gem.bat
12/21/2007 03:57 PM 27 gemhelp.bat
12/24/2007 12:16 PM 91 gemlock

The gem.bat file size is correct, latest One-Click Installer ships
with the same stub files that RubyGems 1.0.x uses.

Also, from your latest output, it seems RUBYOPT is set to
‘rubygems’ (since require it return false).

Can you print the PATH you have? Example:

C:\Documents and Settings\Usuario>echo %PATH%
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Ruby\bin

I don’t know what could be affecting you, but please, replace the
gem.bat you have with this:

====

@ECHO OFF
IF NOT “%~f0” == “~f0” GOTO :WinNT
ECHO.Using 9x command line
@“C:/Ruby/bin/ruby.exe” “gem” %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
ECHO.Using NT command line
“%~d0%~p0ruby.exe” “%~d0%~p0%~n0” %*

====

This is my Windows XP output:

C:\Ruby\bin>gem -v
Using NT command line
1.0.1

C:\Documents and Settings\Usuario>gem -v
Using NT command line
1.0.1

Maybe Vista is using ‘9x’ version of command line processing, becasue
the .bat file, but that seems odd, and couldn’t reproduce locally, so
the more info you can provide, the better.

Waiting for your feedback,

Luis

Hi Luis,

Sorry for the late response. I am off line for several days.

I update the gem.bat with the one you give me. I don’t think it works
either.

And here is the screen output, together with the ECHO %path%.

Once again thank you very much,

Li

############
C:\Users\Alex>gem -v
:1: no such file to load – rubygems (LoadError)

C:>cd ruby\bin

C:\ruby\bin>gem -v
Using NT command line
1.0.1

C:\ruby\bin>c:

C:\ruby\bin>cd\

C:>gem -v
:1: no such file to load – rubygems (LoadError)

C:>cd Users\alex

C:\Users\Alex>ECHO %path%
c:\jruby-1.0.1\bin;C:\Program
Files\Java\jdk1.6.0_02\bin;C:\Windows\system32;C:\Windows;C:\Windows\S
ystem32\Wbem;C:\Program Files\Common Files\Roxio
Shared\DLLShared;C:\Program Files\Common Files\Rox
io Shared\DLLShared;C:\Program Files\Common Files\Roxio
Shared\9.0\DLLShared;C:\Windows\Microsoft.
NET\Framework\v2.0.50727;c:\ruby\bin;
C:\ruby\lib\ruby\gems\1.8;C:\Tcl\bin;c:\jruby-1.0.1\bin;C:\Pro
gram
Files\Java\jdk1.6.0_02\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program
F
iles\Common Files\Roxio Shared\DLLShared;C:\Program Files\Common
Files\Roxio Shared\DLLShared;C:\P
rogram Files\Common Files\Roxio
Shared\9.0\DLLShared;C:\Windows\Microsoft.NET\Framework\v2.0.50727;
c:\ruby\bin; C:\ruby\lib\ruby\gems\1.8;;c:\ruby\bin;

C:\Users\Alex>

On 30 dic, 19:44, Li Chen [email protected] wrote:

1.0.1
C:\Users\Alex>ECHO %path%
F
iles\Common Files\Roxio Shared\DLLShared;C:\Program Files\Common
Files\Roxio Shared\DLLShared;C:\P
rogram Files\Common Files\Roxio
Shared\9.0\DLLShared;C:\Windows\Microsoft.NET\Framework\v2.0.50727;
c:\ruby\bin; C:\ruby\lib\ruby\gems\1.8;;c:\ruby\bin;

Please, look at the first item in your path… jRuby! :stuck_out_tongue:

when calling gem, you’re actually calling jruby gem.

That’s why you don’t get “Using NT command line” echo when calling it
outside c:\ruby\bin

Please, remove jruby from the path and try again.

That one of the problems of having multiple interpreters with the same
executables hanging in the path.

Hey, lucky you didn’t add ruby 1.9 too! :stuck_out_tongue:

HTH,

Luis

PS: btw, there are many attempts to add jruby and ruby\bin too, so
please cleanup your path variables – removing duplicates – to avoid
future problems again.

Luis L. wrote:

Please, remove jruby from the path and try again.

Or update JRuby to something more recent. 1.0.1 is pretty old…

1.1 will be out soon, shipping with RubyGems 1.0.0+.

  • Charlie

Luis L. wrote:

Please, look at the first item in your path… jRuby! :stuck_out_tongue:

when calling gem, you’re actually calling jruby gem.

That’s why you don’t get “Using NT command line” echo when calling it
outside c:\ruby\bin

Thank you very much. I remove the jruby and it works.

Li

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs