require doesn't seem to search $: on Win2K 
Author Message
 require doesn't seem to search $: on Win2K

I have a small program that tries to require "cgi".  I get this error:
e:\ruby\rbweb\rbweb.rb:2:in `require': No such file to load -- cgi
(LoadError)
        from e:\ruby\rbweb\rbweb.rb:2

In the same code above the require line I did a sanity check of puts
$: and got this:

e/ruby/lib/ruby/site_ruby/1.6/i386-cygwin
e/ruby/lib/ruby/site_ruby/1.6
e/ruby/lib/ruby/site_ruby
e/ruby/lib/ruby/1.6/i386-cygwin
e/ruby/lib/ruby/1.6
.

The cgi.rb file is in E:\ruby\lib\ruby\1.6 which is in load path, as
far as I can tell, but the format of the paths are not Windows-ish.

Can anyone help?

Thanks,
Nick



Sat, 08 Nov 2003 00:54:57 GMT  
 require doesn't seem to search $: on Win2K
I'm running on windows 2k and require 'cgi' works fine.  I get slightly
different output from puts $:, though, with /cygdrive/ in front of each
entry.

irb(main):001:0> puts $:
/cygdrive/e/ruby/lib/ruby/site_ruby/1.6/i386-cygwin
/cygdrive/e/ruby/lib/ruby/site_ruby/1.6
/cygdrive/e/ruby/lib/ruby/site_ruby
/cygdrive/e/ruby/lib/ruby/1.6/i386-cygwin
/cygdrive/e/ruby/lib/ruby/1.6
.
nil

Wayne


Quote:
> I have a small program that tries to require "cgi".  I get this error:
> e:\ruby\rbweb\rbweb.rb:2:in `require': No such file to load -- cgi
> (LoadError)
> from e:\ruby\rbweb\rbweb.rb:2

> In the same code above the require line I did a sanity check of puts
> $: and got this:

> e/ruby/lib/ruby/site_ruby/1.6/i386-cygwin
> e/ruby/lib/ruby/site_ruby/1.6
> e/ruby/lib/ruby/site_ruby
> e/ruby/lib/ruby/1.6/i386-cygwin
> e/ruby/lib/ruby/1.6
> .

> The cgi.rb file is in E:\ruby\lib\ruby\1.6 which is in load path, as
> far as I can tell, but the format of the paths are not Windows-ish.

> Can anyone help?

> Thanks,
> Nick



Sat, 08 Nov 2003 02:05:34 GMT  
 require doesn't seem to search $: on Win2K

Quote:
>I have a small program that tries to require "cgi".  I get this error:
>e:\ruby\rbweb\rbweb.rb:2:in `require': No such file to load -- cgi
>(LoadError)
>    from e:\ruby\rbweb\rbweb.rb:2

>In the same code above the require line I did a sanity check of puts
>$: and got this:

>e/ruby/lib/ruby/site_ruby/1.6/i386-cygwin
>e/ruby/lib/ruby/site_ruby/1.6
>e/ruby/lib/ruby/site_ruby
>e/ruby/lib/ruby/1.6/i386-cygwin
>e/ruby/lib/ruby/1.6
>.

i was just about to post a query regarding this problem, so i'll just provide a few more details...
I'm using IIS 5, and i got .rb mapped to the ruby .exe in the standard way: '{ruby bin}\ruby.exe %s %s'.
When i run a little script like Nick's i get the same result, except that /cygwin/ is prefixed to all the paths in $:.
Also, i can get my scripts to work in IIS properly if i do this:
        - open a cmd window
        - start IRB
        - execute 'require "cgi"'
As long as i leave IRB running, the scripts run by IIS will work properly.  weird, huh?
If the solution is to dump IIS and use Apache, i can live with that...

cheers,
ben



Sat, 08 Nov 2003 02:34:53 GMT  
 require doesn't seem to search $: on Win2K


Quote:
>i was just about to post a query regarding this problem, so i'll just
>provide a few more details... I'm using IIS 5, and i got .rb mapped to
>the ruby .exe in the standard way: '{ruby bin}\ruby.exe %s %s'. When i
>run a little script like Nick's i get the same result, except that
>/cygwin/ is prefixed to all the paths in $:. Also, i can get my scripts
>to work in IIS properly if i do this:
>     - open a cmd window
>     - start IRB
>     - execute 'require "cgi"'
>As long as i leave IRB running, the scripts run by IIS will work
>properly.  weird, huh? If the solution is to dump IIS and use Apache, i
>can live with that...

>cheers,
>ben

Ben,
I'm doing exactly the same thing with IIS 5.0. I also have cygwin installed,
but I don't know how IIS and ruby.exe would know anything about it, since
the mapping for the .rb files just points at ruby.exe.

The only way I've been able to work around it so far is to hard-code the
file path "E:\\ruby\\..." in the require statement.

Would anyone else like to speak up?

BTW, what do the second %s give you, and how do you access it?

Regards,
Nick



Sat, 08 Nov 2003 09:37:25 GMT  
 require doesn't seem to search $: on Win2K

Quote:


> i was just about to post a query regarding this problem, so i'll just provide a few more details...
> I'm using IIS 5, and i got .rb mapped to the ruby .exe in the standard way: '{ruby bin}\ruby.exe %s %s'.
> When i run a little script like Nick's i get the same result, except that /cygwin/ is prefixed to all the paths in $:.
> Also, i can get my scripts to work in IIS properly if i do this:
>    - open a cmd window
>    - start IRB
>    - execute 'require "cgi"'
> As long as i leave IRB running, the scripts run by IIS will work properly.  weird, huh?
> If the solution is to dump IIS and use Apache, i can live with that...

> cheers,
> ben

Ben,

My second question is, what version of cygwin1.dll do you have in
ruby/bin and what version do you have in cygwin/bin?

I just upgraded today to 1.3.2 and it made things worse!

Regards,
Nick



Sat, 08 Nov 2003 23:47:30 GMT  
 require doesn't seem to search $: on Win2K

Quote:

> > i was just about to post a query regarding this problem, so i'll
> > just provide a few more details...  I'm using IIS 5, and i got .rb
> > mapped to the ruby .exe in the standard way:

> My second question is, what version of cygwin1.dll do you have in
> ruby/bin and what version do you have in cygwin/bin?

I know nothing about IIS. However, does it somehow override the path
seen by the applications it runs? Is it possible that when run under
IIS your program is using a different Ruby interpreter, or a different
set of DLLs (cygwin or whatever)?

Dave



Sun, 09 Nov 2003 01:04:08 GMT  
 require doesn't seem to search $: on Win2K

Quote:

>My second question is, what version of cygwin1.dll do you have in
>ruby/bin and what version do you have in cygwin/bin?

>I just upgraded today to 1.3.2 and it made things worse!

>Regards,
>Nick

i got version 1.1.6 of cygwin1.dll in ruby\bin, and i don't have a cygwin\bin.  also, to your previous question: i don't know what the second %s in the IIS
mapping for .rb is, but a Ruby CGI won't work without it.  

|| benjamin w jubb - montreal, quebec, canada
||===========================================
|| fight for freedom
|| fight for CANADIAN WORLD DOMINATION
|| http://standonguard.com



Sun, 09 Nov 2003 04:23:03 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. expect's full_buffer doesn't seem to work

2. set VIDEO_MODE_RESTRICTION=CGA doesn't seem to work

3. ios.gets doesn't seem to work as advertised

4. setting LD_LIBRARY_PATH doesn't seem to work?

5. proc doesn't seem to work in NASM

6. Micro Focus CALL-CONVENTION 8 doesn't seem to work

7. Adagide install doesn't seem to work?

8. Temporarily changing error_reporting()...doesn't seem to work

9. problem with exec: import doesn't seem to work

10. ldap.modify_s doesn't seem to work

11. regsub doesn't seem to match largest pattern

12. update doesn't seem to work with scale

 

 
Powered by phpBB® Forum Software