[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Whats going on!?!?

Erik Boling

10/2/2007 2:36:00 PM

Ok so I was programming perfectly fine earlier yesterday, then i got
this idea about instead of going through cmd to open my program, why not
just chose cmd as the program to open it?... bad idea i got this weird
access denied error. Then it would do that to every program i tried to
run, even new ones i made. Then i accidentally set scite as the default
to open the files, so when i ran them in cmd it would just open scite
and show me the code. so i re-installed ruby, and the access denied erro
still pops up when i try and run any ruby program? Any one know what i
need to do to fix this?

Many thanks,
Erik
--
Posted via http://www.ruby-....

11 Answers

Phlip

10/2/2007 2:43:00 PM

0

Erik Boling wrote:

> it would just open scite
> and show me the code. so i re-installed ruby, and the access denied erro
> still pops up when i try and run any ruby program? Any one know what i
> need to do to fix this?

Get CygWin (but not its Ruby), and learn to use BASH, a real command
line interface. After a little easy tuning it's easier than mouse
abuse.

Then get with a Windows tutorial (under the wild assumption you use
Windows), and then learn to de-gunk your system registry. It has a
link to the wrong ruby, possibly rubyw.exe. Uninstalling Ruby won't
remove the link because it's outside Ruby's home folder in the
registry. Back your 'puter up before twiddling with the registry!

Then erase your Windows and get Linux. It supports symlinks, which
make most of that ridiculous registry unneeded.

--
Phlip
http://www.oreilly.com/catalog/9780...
^ assert_xpath

Gordon Thiesfeld

10/2/2007 3:16:00 PM

0

On 10/2/07, Erik Boling <schmode93@yahoo.com> wrote:
> Ok so I was programming perfectly fine earlier yesterday, then i got
> this idea about instead of going through cmd to open my program, why not
> just chose cmd as the program to open it?... bad idea i got this weird
> access denied error. Then it would do that to every program i tried to
> run, even new ones i made. Then i accidentally set scite as the default
> to open the files, so when i ran them in cmd it would just open scite
> and show me the code. so i re-installed ruby, and the access denied erro
> still pops up when i try and run any ruby program? Any one know what i
> need to do to fix this?

While it may be possible to set Windows up to do this, I think it
would cause other problems; for instance, opening a new cmd prompt
each time you type it on the command line. I changed the open action
on .rb files to run cmd.exe, and then I changed it back like this:

C:\>assoc .rb
rb=rbFile

C:\>ftype rbFile
rbFile=cmd.exe "%1" %*

C:\>ftype rbFile="C:\ruby\ruby186\bin\ruby.exe" "%1" %*
rbFile="C:\ruby\ruby186\bin\ruby.exe" "%1" %*

The path to your ruby executable is probably different than mine. Let
me know if that works.

Regards,

Gordon

Arlen Cuss

10/2/2007 3:27:00 PM

0


On Tue, 2007-10-02 at 23:43 +0900, Phlip wrote:
> get Linux. It supports symlinks, which
> make most of that ridiculous registry unneeded.

Just quietly, I don't think it's symlinks which mean we don't need a
registry ...

To the OP: look up on "file associations" in Windows. Gordon's reply is
good.

- Arlen.


Phlip

10/2/2007 6:04:00 PM

0

Arlen Christian Mart Cuss wrote:

> > get Linux. It supports symlinks, which
> > make most of that ridiculous registry unneeded.

> Just quietly, I don't think it's symlinks which mean we don't need a
> registry ...

No, we just need a rambling /etc folder full of spaghetti
configurations, each one written in its own Custom Configuration
Language /Du-Jour/!

> To the OP: look up on "file associations" in Windows. Gordon's reply is
> good.

Jah - I only knew how to hack the registry. (-;

--
Phlip

Erik Boling

10/3/2007 12:16:00 AM

0


C:\>assoc .rb
rb=rbFile

C:\>ftype rbFile
rbFile=cmd.exe "%1" %*

C:\>ftype rbFile="C:\ruby\ruby186\bin\ruby.exe" "%1" %*
rbFile="C:\ruby\ruby186\bin\ruby.exe" "%1" %*

Ok i have really no clue on what you are saying there, are all those
just file locations, do i need to make the?, do i have to create a file
association * which i'm not sure how to do*? thank you for all the
replies but i'm a bit confused right now :\.
--
Posted via http://www.ruby-....

Phlip

10/3/2007 12:30:00 AM

0

Erik Boling wrote:

> C:\>assoc .rb
> .rb=rbFile
>
> C:\>ftype rbFile
> rbFile=cmd.exe "%1" %*
>
> C:\>ftype rbFile="C:\ruby\ruby186\bin\ruby.exe" "%1" %*
> rbFile="C:\ruby\ruby186\bin\ruby.exe" "%1" %*
>
> Ok i have really no clue on what you are saying there, are all those
> just file locations, do i need to make the?, do i have to create a file
> association * which i'm not sure how to do*? thank you for all the
> replies but i'm a bit confused right now :\.

Click on Start, click on Run, type CMD, press Enter, and enter these
commands:

assoc /?
ftype /?

--
Phlip


Erik Boling

10/3/2007 12:42:00 AM

0


> Click on Start, click on Run, type CMD, press Enter, and enter these
> commands:
>
> assoc /?
> ftype /?
Ok here you go, this is what i get, maybe you guys know what i need to
do.. oh yea dont get fooled by my default location, i changed it to that
file a while ago and things have been working fine.


Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\TestProgramsT>assoc /?
Displays or modifies file extension associations

ASSOC [.ext[=[fileType]]]

.ext Specifies the file extension to associate the file type with
fileType Specifies the file type to associate with the file extension

Type ASSOC without parameters to display the current file associations.
If ASSOC is invoked with just a file extension, it displays the current
file association for that file extension. Specify nothing for the file
type and the command will delete the association for the file extension.

C:\TestProgramsT>ftype /?
Displays or modifies file types used in file extension associations

FTYPE [fileType[=[openCommandString]]]

fileType Specifies the file type to examine or change
openCommandString Specifies the open command to use when launching
files
of this type.

Type FTYPE without parameters to display the current file types that
have open command strings defined. FTYPE is invoked with just a file
type, it displays the current open command string for that file type.
Specify nothing for the open command string and the FTYPE command will
delete the open command string for the file type. Within an open
command string %0 or %1 are substituted with the file name being
launched through the assocation. %* gets all the parameters and %2
gets the 1st parameter, %3 the second, etc. %~n gets all the remaining
parameters starting with the nth parameter, where n may be between 2 and
9,
inclusive. For example:

ASSOC .pl=PerlScript
FTYPE PerlScript=perl.exe %1 %*

would allow you to invoke a Perl script as follows:
Press any key to continue . . .
--
Posted via http://www.ruby-....

Erik Boling

10/3/2007 12:55:00 AM

0

Sorry, ok so i figured out what gordon was talking about so i i changed
the ftype and assoc just as he did, then restarted cmd, and I'm still
getting the " is not a valid win32 app" error?
--
Posted via http://www.ruby-....

Erik Boling

10/4/2007 12:04:00 AM

0

Michael Bevilacqua-Linn wrote:
> Indeed! It's a bunch of config files of different formats scattered
> across
> the file system. Scary thing is, that actually does seem to work better
> than the window registry.

ok soooo, what can i do to fix it!?!?!
--
Posted via http://www.ruby-....

Gordon Thiesfeld

10/4/2007 12:31:00 PM

0

>
> ok soooo, what can i do to fix it!?!?!
> --
> Posted via http://www.ruby-....

Here are some things to check:

# Make sure the path to ruby.exe is in your path system environment
variable
C:\>path
PATH=c:\ruby\ruby186\bin;C:\WINDOWS;C:\WINDOWS\System32\Wbem

# Make sure .rb and .rbw are set in the pathext system environment
variable
C:\>echo %pathext%
COM;.EXE;.BAT;.CMD;.RB;.RBW;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.tcl;.PSC1

# If it's a problem with these system environment variables, make sure you
set it in the gui, and not with the set command. Otherwise the
changes won't persist. Here's some info on that:
http://support.microsoft.com...

What is the output of these commands?

ruby -v

ruby -e 'puts "hello world!"

regards,

Gordon