Thibaut Barrère
2010-Jan-25 10:56 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
Hello, doing my first real test on Windows 7 - I installed the latest IronRuby (using the MSI installer) and igem install rake issues the following error: ERROR: While executing gem ... (SystemCallError) unknown scenario - System.UnauthorizedAccessException, C:/Program Files/IronRuby 0.9.3.0/lib/ironruby/gems, Create My understanding is that it''s linked to the permissions in Windows 7. If I manually create the gems folder and allow full control to the current user (not in administrator mode), then I get the following error: ERROR: While executing gem ... (ArgumentError) Illegal characters in path. Is there anyone currently running the MSI installed version of IronRuby on Windows 7 without these issues ? thanks, -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100125/6948c3d8/attachment.html>
Ivan Porto Carrero
2010-Jan-25 11:15 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
move ironruby to a location without a space in the path like C:\ironruby --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Mon, Jan 25, 2010 at 11:56 AM, Thibaut Barr?re <thibaut.barrere at gmail.com> wrote:> Hello, > > doing my first real test on Windows 7 - I installed the latest IronRuby > (using the MSI installer) and igem install rake issues the following error: > > ERROR: While executing gem ... (SystemCallError) > unknown scenario - System.UnauthorizedAccessException, C:/Program > Files/IronRuby 0.9.3.0/lib/ironruby/gems, Create > > My understanding is that it''s linked to the permissions in Windows 7. > > If I manually create the gems folder and allow full control to the current > user (not in administrator mode), then I get the following error: > > ERROR: While executing gem ... (ArgumentError) > Illegal characters in path. > > Is there anyone currently running the MSI installed version of IronRuby on > Windows 7 without these issues ? > > thanks, > > -- Thibaut > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100125/a70331e5/attachment.html>
Thibaut Barrère
2010-Jan-25 12:58 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
> > move ironruby to a location without a space in the path like C:\ironruby >thanks - will try that. Is it worth filing a bug ? -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100125/7ebd364c/attachment.html>
Ivan Porto Carrero
2010-Jan-25 15:03 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
it''s a known issue that should be fixed in the next release, AFAIK --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Mon, Jan 25, 2010 at 1:58 PM, Thibaut Barr?re <thibaut.barrere at gmail.com>wrote:> move ironruby to a location without a space in the path like C:\ironruby >> > > thanks - will try that. Is it worth filing a bug ? > > -- Thibaut > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100125/0bb4a289/attachment.html>
Thibaut Barrère
2010-Jan-25 15:20 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
> > it''s a known issue that should be fixed in the next release, AFAIK > >Thanks Ivan, -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100125/14566571/attachment.html>
Shri Borde
2010-Jan-25 19:30 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
Ivan, do you remember what the known issue is? I can''t remember seeing a discussion about UnauthorizedAccessException. Just making sure that the bug is really being tracked From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Monday, January 25, 2010 7:21 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) it''s a known issue that should be fixed in the next release, AFAIK Thanks Ivan, -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100125/feec0b84/attachment.html>
Ivan Porto Carrero
2010-Jan-25 20:42 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
Program files is a protected location and contains a space in the path. I couldn''t find a workitem. But all the problems would be solved by mimicking jruby and ruby''s way and just putting it in C:\ironruby. This workitem is related though http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=2969 --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Mon, Jan 25, 2010 at 8:30 PM, Shri Borde <Shri.Borde at microsoft.com>wrote:> Ivan, do you remember what the known issue is? I can?t remember seeing a > discussion about UnauthorizedAccessException. Just making sure that the bug > is really being tracked > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Thibaut Barr?re > *Sent:* Monday, January 25, 2010 7:21 AM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > it''s a known issue that should be fixed in the next release, AFAIK > > > > > Thanks Ivan, > > > > -- Thibaut > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100125/ab05b507/attachment-0001.html>
Shri Borde
2010-Jan-25 21:41 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
Added a comment to the workitem? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Monday, January 25, 2010 12:43 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Program files is a protected location and contains a space in the path. I couldn''t find a workitem. But all the problems would be solved by mimicking jruby and ruby''s way and just putting it in C:\ironruby. This workitem is related though http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=2969 --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Mon, Jan 25, 2010 at 8:30 PM, Shri Borde <Shri.Borde at microsoft.com<mailto:Shri.Borde at microsoft.com>> wrote: Ivan, do you remember what the known issue is? I can?t remember seeing a discussion about UnauthorizedAccessException. Just making sure that the bug is really being tracked From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Thibaut Barr?re Sent: Monday, January 25, 2010 7:21 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) it''s a known issue that should be fixed in the next release, AFAIK Thanks Ivan, -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100125/0c500f47/attachment.html>
Shri Borde
2010-Jan-25 21:55 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
Btw, c:\ironruby will still need admin priviledges to install to, right? Does the one-click installer make the gem folder writable to all users (or atleast all Admin users)? What about on *nix? Without making the gem folder writable, ?igem install? will still fail. Making the folder writable to all users is a security hole, and ideally RubyGems will support a way to install to a per-user location, or elevate permission otherwise. I believe you need to use ?sudo gem install? on *nix. From: Shri Borde Sent: Monday, January 25, 2010 1:42 PM To: ironruby-core at rubyforge.org Subject: RE: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Added a comment to the workitem? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Monday, January 25, 2010 12:43 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Program files is a protected location and contains a space in the path. I couldn''t find a workitem. But all the problems would be solved by mimicking jruby and ruby''s way and just putting it in C:\ironruby. This workitem is related though http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=2969 --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Mon, Jan 25, 2010 at 8:30 PM, Shri Borde <Shri.Borde at microsoft.com<mailto:Shri.Borde at microsoft.com>> wrote: Ivan, do you remember what the known issue is? I can?t remember seeing a discussion about UnauthorizedAccessException. Just making sure that the bug is really being tracked From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Thibaut Barr?re Sent: Monday, January 25, 2010 7:21 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) it''s a known issue that should be fixed in the next release, AFAIK Thanks Ivan, -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100125/0a94bdcc/attachment-0001.html>
Shri Borde
2010-Jan-26 00:47 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
Jim and I were discussing the desired behavior, and it is a choice between security and convenience. http://ironpython-urls.blogspot.com/2009/10/distributing-ironpython-packages.html has information on how Python is dealing with the admin issue. Packages (the equivalent of gems) are installed to a per-user location. The IronRuby equivalent would be that every user has to install his/her own set of gems, and could be implemented by setting the GEM_PATH environment variable for the user to point to something like %USERPROFILE%. Any objection to this behavior? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday, January 25, 2010 1:55 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Btw, c:\ironruby will still need admin priviledges to install to, right? Does the one-click installer make the gem folder writable to all users (or atleast all Admin users)? What about on *nix? Without making the gem folder writable, ?igem install? will still fail. Making the folder writable to all users is a security hole, and ideally RubyGems will support a way to install to a per-user location, or elevate permission otherwise. I believe you need to use ?sudo gem install? on *nix. From: Shri Borde Sent: Monday, January 25, 2010 1:42 PM To: ironruby-core at rubyforge.org Subject: RE: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Added a comment to the workitem? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Monday, January 25, 2010 12:43 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Program files is a protected location and contains a space in the path. I couldn''t find a workitem. But all the problems would be solved by mimicking jruby and ruby''s way and just putting it in C:\ironruby. This workitem is related though http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=2969 --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Mon, Jan 25, 2010 at 8:30 PM, Shri Borde <Shri.Borde at microsoft.com<mailto:Shri.Borde at microsoft.com>> wrote: Ivan, do you remember what the known issue is? I can?t remember seeing a discussion about UnauthorizedAccessException. Just making sure that the bug is really being tracked From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Thibaut Barr?re Sent: Monday, January 25, 2010 7:21 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) it''s a known issue that should be fixed in the next release, AFAIK Thanks Ivan, -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/53d19033/attachment.html>
Shri Borde
2010-Jan-26 00:58 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
Just realized that setting GEM_PATH will affect MRI too which would be a problem. So there will have to be some other way to implement the per-user IronRuby-specific location for gems. Assuming we can figure this out, the question still is if the per-user gems model sounds good? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday, January 25, 2010 4:47 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Jim and I were discussing the desired behavior, and it is a choice between security and convenience. http://ironpython-urls.blogspot.com/2009/10/distributing-ironpython-packages.html has information on how Python is dealing with the admin issue. Packages (the equivalent of gems) are installed to a per-user location. The IronRuby equivalent would be that every user has to install his/her own set of gems, and could be implemented by setting the GEM_PATH environment variable for the user to point to something like %USERPROFILE%. Any objection to this behavior? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday, January 25, 2010 1:55 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Btw, c:\ironruby will still need admin priviledges to install to, right? Does the one-click installer make the gem folder writable to all users (or atleast all Admin users)? What about on *nix? Without making the gem folder writable, ?igem install? will still fail. Making the folder writable to all users is a security hole, and ideally RubyGems will support a way to install to a per-user location, or elevate permission otherwise. I believe you need to use ?sudo gem install? on *nix. From: Shri Borde Sent: Monday, January 25, 2010 1:42 PM To: ironruby-core at rubyforge.org Subject: RE: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Added a comment to the workitem? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Monday, January 25, 2010 12:43 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Program files is a protected location and contains a space in the path. I couldn''t find a workitem. But all the problems would be solved by mimicking jruby and ruby''s way and just putting it in C:\ironruby. This workitem is related though http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=2969 --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Mon, Jan 25, 2010 at 8:30 PM, Shri Borde <Shri.Borde at microsoft.com<mailto:Shri.Borde at microsoft.com>> wrote: Ivan, do you remember what the known issue is? I can?t remember seeing a discussion about UnauthorizedAccessException. Just making sure that the bug is really being tracked From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Thibaut Barr?re Sent: Monday, January 25, 2010 7:21 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) it''s a known issue that should be fixed in the next release, AFAIK Thanks Ivan, -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/9d0ad57e/attachment-0001.html>
Jim Deville
2010-Jan-26 01:19 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
Ideally we would be setting GEM_PATH to somewhere in AppData. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday, January 25, 2010 4:47 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Jim and I were discussing the desired behavior, and it is a choice between security and convenience. http://ironpython-urls.blogspot.com/2009/10/distributing-ironpython-packages.html has information on how Python is dealing with the admin issue. Packages (the equivalent of gems) are installed to a per-user location. The IronRuby equivalent would be that every user has to install his/her own set of gems, and could be implemented by setting the GEM_PATH environment variable for the user to point to something like %USERPROFILE%. Any objection to this behavior? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Monday, January 25, 2010 1:55 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Btw, c:\ironruby will still need admin priviledges to install to, right? Does the one-click installer make the gem folder writable to all users (or atleast all Admin users)? What about on *nix? Without making the gem folder writable, ?igem install? will still fail. Making the folder writable to all users is a security hole, and ideally RubyGems will support a way to install to a per-user location, or elevate permission otherwise. I believe you need to use ?sudo gem install? on *nix. From: Shri Borde Sent: Monday, January 25, 2010 1:42 PM To: ironruby-core at rubyforge.org Subject: RE: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Added a comment to the workitem? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Monday, January 25, 2010 12:43 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Program files is a protected location and contains a space in the path. I couldn''t find a workitem. But all the problems would be solved by mimicking jruby and ruby''s way and just putting it in C:\ironruby. This workitem is related though http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=2969 --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Mon, Jan 25, 2010 at 8:30 PM, Shri Borde <Shri.Borde at microsoft.com<mailto:Shri.Borde at microsoft.com>> wrote: Ivan, do you remember what the known issue is? I can?t remember seeing a discussion about UnauthorizedAccessException. Just making sure that the bug is really being tracked From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Thibaut Barr?re Sent: Monday, January 25, 2010 7:21 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) it''s a known issue that should be fixed in the next release, AFAIK Thanks Ivan, -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/b07984e6/attachment-0001.html>
Will Green
2010-Jan-26 05:06 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
Per-user gems should not be the default. In RubyInstaller (mingw MRI), as well as MRI on Linux, and I believe OS X, system-wide gems are the default. This, of course, would require elevation (sudo gem install xxx). -- Will Green http://hotgazpacho.org/ On Mon, Jan 25, 2010 at 7:58 PM, Shri Borde <Shri.Borde at microsoft.com>wrote:> Just realized that setting GEM_PATH will affect MRI too which would be a > problem. So there will have to be some other way to implement the per-user > IronRuby-specific location for gems. Assuming we can figure this out, the > question still is if the per-user gems model sounds good? > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Shri Borde > *Sent:* Monday, January 25, 2010 4:47 PM > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Jim and I were discussing the desired behavior, and it is a choice between > security and convenience. > http://ironpython-urls.blogspot.com/2009/10/distributing-ironpython-packages.htmlhas information on how Python is dealing with the admin issue. Packages (the > equivalent of gems) are installed to a per-user location. The IronRuby > equivalent would be that every user has to install his/her own set of gems, > and could be implemented by setting the GEM_PATH environment variable for > the user to point to something like %USERPROFILE%. Any objection to this > behavior? > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Shri Borde > *Sent:* Monday, January 25, 2010 1:55 PM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Btw, c:\ironruby will still need admin priviledges to install to, right? > > > > Does the one-click installer make the gem folder writable to all users (or > atleast all Admin users)? What about on *nix? Without making the gem folder > writable, ?igem install? will still fail. Making the folder writable to all > users is a security hole, and ideally RubyGems will support a way to install > to a per-user location, or elevate permission otherwise. I believe you need > to use ?sudo gem install? on *nix. > > > > *From:* Shri Borde > *Sent:* Monday, January 25, 2010 1:42 PM > *To:* ironruby-core at rubyforge.org > *Subject:* RE: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Added a comment to the workitem? > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Ivan Porto Carrero > *Sent:* Monday, January 25, 2010 12:43 PM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Program files is a protected location and contains a space in the path. I > couldn''t find a workitem. But all the problems would be solved > by mimicking jruby and ruby''s way and just putting it in C:\ironruby. > > > > This workitem is related though > > http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=2969 > > > > --- > Met vriendelijke groeten - Best regards - Salutations > Ivan Porto Carrero > Blog: http://flanders.co.nz > Twitter: http://twitter.com/casualjim > Author of IronRuby in Action (http://manning.com/carrero) > > On Mon, Jan 25, 2010 at 8:30 PM, Shri Borde <Shri.Borde at microsoft.com> > wrote: > > Ivan, do you remember what the known issue is? I can?t remember seeing a > discussion about UnauthorizedAccessException. Just making sure that the bug > is really being tracked > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Thibaut Barr?re > *Sent:* Monday, January 25, 2010 7:21 AM > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > it''s a known issue that should be fixed in the next release, AFAIK > > > > > Thanks Ivan, > > > > -- Thibaut > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/12dff41c/attachment.html>
Thibaut Barrère
2010-Jan-26 09:16 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as well as MRI on Linux, and I believe OS X, system-wide gems are > the default. This, of course, would require elevation (sudo gem install xxx).I believe per-user gems is now the default (it wasn''t in the past, but if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now installs gems into ~/.gem if GEM_HOME is not writable. Use --no-user-install command-line switch to disable this behavior.''). Here''s what happens on my machine (OS X): ~$ gem list | grep less ~$ sudo gem list | grep less ~$ gem install less (...) ~$ gem list | grep less less (1.2.21) ~$ sudo gem list | grep less (empty) ~$ gem -v 1.3.5 ~$ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] -- Thibaut
Will Green
2010-Jan-26 17:03 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
Yes, that occurred to me this morning. ;-) So, runas /user:mymachine\administrator igem install foo for globals gems, right? -- Will Green http://hotgazpacho.org/ On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re <thibaut.barrere at gmail.com>wrote:> > Per-user gems should not be the default. In RubyInstaller (mingw MRI), as > well as MRI on Linux, and I believe OS X, system-wide gems are > > the default. This, of course, would require elevation (sudo gem install > xxx). > > I believe per-user gems is now the default (it wasn''t in the past, but > if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - > http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now > installs gems into ~/.gem if GEM_HOME is not writable. Use > --no-user-install command-line switch to disable this behavior.''). > > Here''s what happens on my machine (OS X): > > ~$ gem list | grep less > ~$ sudo gem list | grep less > ~$ gem install less > (...) > ~$ gem list | grep less > less (1.2.21) > ~$ sudo gem list | grep less > (empty) > > ~$ gem -v > 1.3.5 > ~$ ruby -v > ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] > > -- Thibaut > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/07cab2c6/attachment.html>
Jim Deville
2010-Jan-26 17:17 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
There are a couple of differences that would be apparent for this proposed solution: 1) Runas /user?. Is much longer than sudo ;) 2) The normal installation directory is owned by TrustedInstaller and Admins have no rights by default. We wouldn?t have a supported way to share gems at this time, since that does have security risks. Each user would have to install their own gems, but (unsupported) you should be able to move GEM_PATH (assuming we can figure out how to share between IronRuby and Ruby) to a shared location and change permissions on it. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green Sent: Tuesday, January 26, 2010 9:03 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Yes, that occurred to me this morning. ;-) So, runas /user:mymachine\administrator igem install foo for globals gems, right? -- Will Green http://hotgazpacho.org/ On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re <thibaut.barrere at gmail.com<mailto:thibaut.barrere at gmail.com>> wrote:> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as well as MRI on Linux, and I believe OS X, system-wide gems are > the default. This, of course, would require elevation (sudo gem install xxx).I believe per-user gems is now the default (it wasn''t in the past, but if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now installs gems into ~/.gem if GEM_HOME is not writable. Use --no-user-install command-line switch to disable this behavior.''). Here''s what happens on my machine (OS X): ~$ gem list | grep less ~$ sudo gem list | grep less ~$ gem install less (...) ~$ gem list | grep less less (1.2.21) ~$ sudo gem list | grep less (empty) ~$ gem -v 1.3.5 ~$ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/c42ca64a/attachment-0001.html>
C. K. Ponnappa
2010-Jan-26 17:28 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
> > I believe per-user gems is now the defaultThat''s right - now if you sudo install a system wide gem, if not, it just creates a .gems in your home dir and installs there. Of course, the local gems are only available to Ruby apps running as that user. Cheers, Sidu. Thibaut Barr?re wrote:>> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as well as MRI on Linux, and I believe OS X, system-wide gems are >> the default. This, of course, would require elevation (sudo gem install xxx). >> > > I believe per-user gems is now the default (it wasn''t in the past, but > if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - > http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now > installs gems into ~/.gem if GEM_HOME is not writable. Use > --no-user-install command-line switch to disable this behavior.''). > > Here''s what happens on my machine (OS X): > > ~$ gem list | grep less > ~$ sudo gem list | grep less > ~$ gem install less > (...) > ~$ gem list | grep less > less (1.2.21) > ~$ sudo gem list | grep less > (empty) > > ~$ gem -v > 1.3.5 > ~$ ruby -v > ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] > > -- Thibaut > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >
Shri Borde
2010-Jan-26 19:08 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
Another way to simulate ?sudo? is to use an elevated Command Prompt. http://www.sevenforums.com/tutorials/11841-run-administrator.html tells you how. If you are using the command prompt a lot, you only need to deal with the UAC dialog box once when you open the elevated Command Prompt. After that, all commands executed from the Command Prompt run elevated. Jim, from an elevated Command prompt, I was able to create a new file in %ProgramFiles% using notepad, and did not get any UAC dialog box. This would mean that ?gem install? should also be able to install gems to %ProgramFiles%. Not sure how this reconciles with your comment about TrustedInstaller. Thibaut, could you try using ?igem install ?user-install?? (I wonder if IronRuby needs to catch the System.UnauthorizedAccessException exception and raise a Ruby exception for RubyGems to do the right thing.) Could you also separately try running from an elevated Command Prompt? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 9:18 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There are a couple of differences that would be apparent for this proposed solution: 1) Runas /user?. Is much longer than sudo ;) 2) The normal installation directory is owned by TrustedInstaller and Admins have no rights by default. We wouldn?t have a supported way to share gems at this time, since that does have security risks. Each user would have to install their own gems, but (unsupported) you should be able to move GEM_PATH (assuming we can figure out how to share between IronRuby and Ruby) to a shared location and change permissions on it. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green Sent: Tuesday, January 26, 2010 9:03 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Yes, that occurred to me this morning. ;-) So, runas /user:mymachine\administrator igem install foo for globals gems, right? -- Will Green http://hotgazpacho.org/ On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re <thibaut.barrere at gmail.com<mailto:thibaut.barrere at gmail.com>> wrote:> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as well as MRI on Linux, and I believe OS X, system-wide gems are > the default. This, of course, would require elevation (sudo gem install xxx).I believe per-user gems is now the default (it wasn''t in the past, but if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now installs gems into ~/.gem if GEM_HOME is not writable. Use --no-user-install command-line switch to disable this behavior.''). Here''s what happens on my machine (OS X): ~$ gem list | grep less ~$ sudo gem list | grep less ~$ gem install less (...) ~$ gem list | grep less less (1.2.21) ~$ sudo gem list | grep less (empty) ~$ gem -v 1.3.5 ~$ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/d8ac1f6e/attachment-0001.html>
Jim Deville
2010-Jan-26 19:36 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
[cid:image001.png at 01CA9E7B.BD018580] That?s what happens when I do notepad ''C:\Program Files''\foo.txt from an elevated or unelevated command prompt. (If you don?t get the picture, it?s a dialog box that says ?Access is denied?). Have you modified your Program Files permissons? JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:09 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Another way to simulate ?sudo? is to use an elevated Command Prompt. http://www.sevenforums.com/tutorials/11841-run-administrator.html tells you how. If you are using the command prompt a lot, you only need to deal with the UAC dialog box once when you open the elevated Command Prompt. After that, all commands executed from the Command Prompt run elevated. Jim, from an elevated Command prompt, I was able to create a new file in %ProgramFiles% using notepad, and did not get any UAC dialog box. This would mean that ?gem install? should also be able to install gems to %ProgramFiles%. Not sure how this reconciles with your comment about TrustedInstaller. Thibaut, could you try using ?igem install ?user-install?? (I wonder if IronRuby needs to catch the System.UnauthorizedAccessException exception and raise a Ruby exception for RubyGems to do the right thing.) Could you also separately try running from an elevated Command Prompt? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 9:18 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There are a couple of differences that would be apparent for this proposed solution: 1) Runas /user?. Is much longer than sudo ;) 2) The normal installation directory is owned by TrustedInstaller and Admins have no rights by default. We wouldn?t have a supported way to share gems at this time, since that does have security risks. Each user would have to install their own gems, but (unsupported) you should be able to move GEM_PATH (assuming we can figure out how to share between IronRuby and Ruby) to a shared location and change permissions on it. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green Sent: Tuesday, January 26, 2010 9:03 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Yes, that occurred to me this morning. ;-) So, runas /user:mymachine\administrator igem install foo for globals gems, right? -- Will Green http://hotgazpacho.org/ On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re <thibaut.barrere at gmail.com<mailto:thibaut.barrere at gmail.com>> wrote:> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as well as MRI on Linux, and I believe OS X, system-wide gems are > the default. This, of course, would require elevation (sudo gem install xxx).I believe per-user gems is now the default (it wasn''t in the past, but if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now installs gems into ~/.gem if GEM_HOME is not writable. Use --no-user-install command-line switch to disable this behavior.''). Here''s what happens on my machine (OS X): ~$ gem list | grep less ~$ sudo gem list | grep less ~$ gem install less (...) ~$ gem list | grep less less (1.2.21) ~$ sudo gem list | grep less (empty) ~$ gem -v 1.3.5 ~$ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/9820c119/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 3298 bytes Desc: image001.png URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/9820c119/attachment-0001.png>
Shri Borde
2010-Jan-26 19:43 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
There indeed is a difference in behavior between IronRuby and MRI when creating a file in %ProgramFiles% from a non-elevated process. MRI silently writes to USERPROFILE. IronRuby raises Errno::EACCES. I have opened http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=3685 to track this. I don?t see the System.UnauthorizedAccessException though. D:\>ruby -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" D:\>dir "c:\Program Files\foo.txt" File Not Found D:\>dir "%USERPROFILE%\AppData\Local\VirtualStore\Program Files\foo.txt" 01/26/2010 11:39 AM 0 foo.txt 1 File(s) 0 bytes 0 Dir(s) 122,124,869,632 bytes free D:\>rbx -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" mscorlib:0:in `WinIOError'': Access to the path ''c:\\Program Files\\foo.txt'' is denied. (Errno::EACCES) From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:09 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Another way to simulate ?sudo? is to use an elevated Command Prompt. http://www.sevenforums.com/tutorials/11841-run-administrator.html tells you how. If you are using the command prompt a lot, you only need to deal with the UAC dialog box once when you open the elevated Command Prompt. After that, all commands executed from the Command Prompt run elevated. Jim, from an elevated Command prompt, I was able to create a new file in %ProgramFiles% using notepad, and did not get any UAC dialog box. This would mean that ?gem install? should also be able to install gems to %ProgramFiles%. Not sure how this reconciles with your comment about TrustedInstaller. Thibaut, could you try using ?igem install ?user-install?? (I wonder if IronRuby needs to catch the System.UnauthorizedAccessException exception and raise a Ruby exception for RubyGems to do the right thing.) Could you also separately try running from an elevated Command Prompt? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 9:18 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There are a couple of differences that would be apparent for this proposed solution: 1) Runas /user?. Is much longer than sudo ;) 2) The normal installation directory is owned by TrustedInstaller and Admins have no rights by default. We wouldn?t have a supported way to share gems at this time, since that does have security risks. Each user would have to install their own gems, but (unsupported) you should be able to move GEM_PATH (assuming we can figure out how to share between IronRuby and Ruby) to a shared location and change permissions on it. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green Sent: Tuesday, January 26, 2010 9:03 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Yes, that occurred to me this morning. ;-) So, runas /user:mymachine\administrator igem install foo for globals gems, right? -- Will Green http://hotgazpacho.org/ On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re <thibaut.barrere at gmail.com<mailto:thibaut.barrere at gmail.com>> wrote:> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as well as MRI on Linux, and I believe OS X, system-wide gems are > the default. This, of course, would require elevation (sudo gem install xxx).I believe per-user gems is now the default (it wasn''t in the past, but if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now installs gems into ~/.gem if GEM_HOME is not writable. Use --no-user-install command-line switch to disable this behavior.''). Here''s what happens on my machine (OS X): ~$ gem list | grep less ~$ sudo gem list | grep less ~$ gem install less (...) ~$ gem list | grep less less (1.2.21) ~$ sudo gem list | grep less (empty) ~$ gem -v 1.3.5 ~$ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/297ac921/attachment-0001.html>
Jim Deville
2010-Jan-26 19:54 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
Hm, that?s interesting? MRI gets redirected to the virtual store but IronRuby does not, I wonder if that is more of a .NET issue than a IronRuby problem? JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:44 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There indeed is a difference in behavior between IronRuby and MRI when creating a file in %ProgramFiles% from a non-elevated process. MRI silently writes to USERPROFILE. IronRuby raises Errno::EACCES. I have opened http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=3685 to track this. I don?t see the System.UnauthorizedAccessException though. D:\>ruby -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" D:\>dir "c:\Program Files\foo.txt" File Not Found D:\>dir "%USERPROFILE%\AppData\Local\VirtualStore\Program Files\foo.txt" 01/26/2010 11:39 AM 0 foo.txt 1 File(s) 0 bytes 0 Dir(s) 122,124,869,632 bytes free D:\>rbx -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" mscorlib:0:in `WinIOError'': Access to the path ''c:\\Program Files\\foo.txt'' is denied. (Errno::EACCES) From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:09 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Another way to simulate ?sudo? is to use an elevated Command Prompt. http://www.sevenforums.com/tutorials/11841-run-administrator.html tells you how. If you are using the command prompt a lot, you only need to deal with the UAC dialog box once when you open the elevated Command Prompt. After that, all commands executed from the Command Prompt run elevated. Jim, from an elevated Command prompt, I was able to create a new file in %ProgramFiles% using notepad, and did not get any UAC dialog box. This would mean that ?gem install? should also be able to install gems to %ProgramFiles%. Not sure how this reconciles with your comment about TrustedInstaller. Thibaut, could you try using ?igem install ?user-install?? (I wonder if IronRuby needs to catch the System.UnauthorizedAccessException exception and raise a Ruby exception for RubyGems to do the right thing.) Could you also separately try running from an elevated Command Prompt? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 9:18 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There are a couple of differences that would be apparent for this proposed solution: 1) Runas /user?. Is much longer than sudo ;) 2) The normal installation directory is owned by TrustedInstaller and Admins have no rights by default. We wouldn?t have a supported way to share gems at this time, since that does have security risks. Each user would have to install their own gems, but (unsupported) you should be able to move GEM_PATH (assuming we can figure out how to share between IronRuby and Ruby) to a shared location and change permissions on it. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green Sent: Tuesday, January 26, 2010 9:03 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Yes, that occurred to me this morning. ;-) So, runas /user:mymachine\administrator igem install foo for globals gems, right? -- Will Green http://hotgazpacho.org/ On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re <thibaut.barrere at gmail.com<mailto:thibaut.barrere at gmail.com>> wrote:> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as well as MRI on Linux, and I believe OS X, system-wide gems are > the default. This, of course, would require elevation (sudo gem install xxx).I believe per-user gems is now the default (it wasn''t in the past, but if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now installs gems into ~/.gem if GEM_HOME is not writable. Use --no-user-install command-line switch to disable this behavior.''). Here''s what happens on my machine (OS X): ~$ gem list | grep less ~$ sudo gem list | grep less ~$ gem install less (...) ~$ gem list | grep less less (1.2.21) ~$ sudo gem list | grep less (empty) ~$ gem -v 1.3.5 ~$ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/3b98690b/attachment-0001.html>
Jim Deville
2010-Jan-26 20:01 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
That one also repro?s for me even though the notepad case doesn?t? JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 11:54 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Hm, that?s interesting? MRI gets redirected to the virtual store but IronRuby does not, I wonder if that is more of a .NET issue than a IronRuby problem? JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:44 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There indeed is a difference in behavior between IronRuby and MRI when creating a file in %ProgramFiles% from a non-elevated process. MRI silently writes to USERPROFILE. IronRuby raises Errno::EACCES. I have opened http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=3685 to track this. I don?t see the System.UnauthorizedAccessException though. D:\>ruby -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" D:\>dir "c:\Program Files\foo.txt" File Not Found D:\>dir "%USERPROFILE%\AppData\Local\VirtualStore\Program Files\foo.txt" 01/26/2010 11:39 AM 0 foo.txt 1 File(s) 0 bytes 0 Dir(s) 122,124,869,632 bytes free D:\>rbx -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" mscorlib:0:in `WinIOError'': Access to the path ''c:\\Program Files\\foo.txt'' is denied. (Errno::EACCES) From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:09 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Another way to simulate ?sudo? is to use an elevated Command Prompt. http://www.sevenforums.com/tutorials/11841-run-administrator.html tells you how. If you are using the command prompt a lot, you only need to deal with the UAC dialog box once when you open the elevated Command Prompt. After that, all commands executed from the Command Prompt run elevated. Jim, from an elevated Command prompt, I was able to create a new file in %ProgramFiles% using notepad, and did not get any UAC dialog box. This would mean that ?gem install? should also be able to install gems to %ProgramFiles%. Not sure how this reconciles with your comment about TrustedInstaller. Thibaut, could you try using ?igem install ?user-install?? (I wonder if IronRuby needs to catch the System.UnauthorizedAccessException exception and raise a Ruby exception for RubyGems to do the right thing.) Could you also separately try running from an elevated Command Prompt? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 9:18 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There are a couple of differences that would be apparent for this proposed solution: 1) Runas /user?. Is much longer than sudo ;) 2) The normal installation directory is owned by TrustedInstaller and Admins have no rights by default. We wouldn?t have a supported way to share gems at this time, since that does have security risks. Each user would have to install their own gems, but (unsupported) you should be able to move GEM_PATH (assuming we can figure out how to share between IronRuby and Ruby) to a shared location and change permissions on it. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green Sent: Tuesday, January 26, 2010 9:03 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Yes, that occurred to me this morning. ;-) So, runas /user:mymachine\administrator igem install foo for globals gems, right? -- Will Green http://hotgazpacho.org/ On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re <thibaut.barrere at gmail.com<mailto:thibaut.barrere at gmail.com>> wrote:> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as well as MRI on Linux, and I believe OS X, system-wide gems are > the default. This, of course, would require elevation (sudo gem install xxx).I believe per-user gems is now the default (it wasn''t in the past, but if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now installs gems into ~/.gem if GEM_HOME is not writable. Use --no-user-install command-line switch to disable this behavior.''). Here''s what happens on my machine (OS X): ~$ gem list | grep less ~$ sudo gem list | grep less ~$ gem install less (...) ~$ gem list | grep less less (1.2.21) ~$ sudo gem list | grep less (empty) ~$ gem -v 1.3.5 ~$ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/ccc00ccc/attachment-0001.html>
Shri Borde
2010-Jan-26 20:03 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
You have user error. Put the end-quote after foo.txt. You have it after Program Files. Notepad will try to open the folder, and that is causing the access-denied. Jimmy got the same error, but it went away after he moved the quote to the end. Notepad does prompt me to save to a different location if run from a non-elevated Command Prompt. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 11:36 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) [cid:image001.png at 01CA9E7F.09170820] That?s what happens when I do notepad ''C:\Program Files''\foo.txt from an elevated or unelevated command prompt. (If you don?t get the picture, it?s a dialog box that says ?Access is denied?). Have you modified your Program Files permissons? JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:09 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Another way to simulate ?sudo? is to use an elevated Command Prompt. http://www.sevenforums.com/tutorials/11841-run-administrator.html tells you how. If you are using the command prompt a lot, you only need to deal with the UAC dialog box once when you open the elevated Command Prompt. After that, all commands executed from the Command Prompt run elevated. Jim, from an elevated Command prompt, I was able to create a new file in %ProgramFiles% using notepad, and did not get any UAC dialog box. This would mean that ?gem install? should also be able to install gems to %ProgramFiles%. Not sure how this reconciles with your comment about TrustedInstaller. Thibaut, could you try using ?igem install ?user-install?? (I wonder if IronRuby needs to catch the System.UnauthorizedAccessException exception and raise a Ruby exception for RubyGems to do the right thing.) Could you also separately try running from an elevated Command Prompt? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 9:18 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There are a couple of differences that would be apparent for this proposed solution: 1) Runas /user?. Is much longer than sudo ;) 2) The normal installation directory is owned by TrustedInstaller and Admins have no rights by default. We wouldn?t have a supported way to share gems at this time, since that does have security risks. Each user would have to install their own gems, but (unsupported) you should be able to move GEM_PATH (assuming we can figure out how to share between IronRuby and Ruby) to a shared location and change permissions on it. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green Sent: Tuesday, January 26, 2010 9:03 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Yes, that occurred to me this morning. ;-) So, runas /user:mymachine\administrator igem install foo for globals gems, right? -- Will Green http://hotgazpacho.org/ On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re <thibaut.barrere at gmail.com<mailto:thibaut.barrere at gmail.com>> wrote:> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as well as MRI on Linux, and I believe OS X, system-wide gems are > the default. This, of course, would require elevation (sudo gem install xxx).I believe per-user gems is now the default (it wasn''t in the past, but if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now installs gems into ~/.gem if GEM_HOME is not writable. Use --no-user-install command-line switch to disable this behavior.''). Here''s what happens on my machine (OS X): ~$ gem list | grep less ~$ sudo gem list | grep less ~$ gem install less (...) ~$ gem list | grep less less (1.2.21) ~$ sudo gem list | grep less (empty) ~$ gem -v 1.3.5 ~$ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/c367051c/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 3298 bytes Desc: image001.png URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/c367051c/attachment-0001.png>
Shri Borde
2010-Jan-26 20:06 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
Might be a .NET issue, but we should work around it in that case. What I am curious about though is if MRI is installed to Program Files, will ?gem install? also silently install to the virtual store if it is run without elevation. If the redirecting is done at the Ruby/OS level, then RubyGems does not need to do anything, and so ?user-install should not be needed at all. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 11:54 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Hm, that?s interesting? MRI gets redirected to the virtual store but IronRuby does not, I wonder if that is more of a .NET issue than a IronRuby problem? JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:44 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There indeed is a difference in behavior between IronRuby and MRI when creating a file in %ProgramFiles% from a non-elevated process. MRI silently writes to USERPROFILE. IronRuby raises Errno::EACCES. I have opened http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=3685 to track this. I don?t see the System.UnauthorizedAccessException though. D:\>ruby -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" D:\>dir "c:\Program Files\foo.txt" File Not Found D:\>dir "%USERPROFILE%\AppData\Local\VirtualStore\Program Files\foo.txt" 01/26/2010 11:39 AM 0 foo.txt 1 File(s) 0 bytes 0 Dir(s) 122,124,869,632 bytes free D:\>rbx -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" mscorlib:0:in `WinIOError'': Access to the path ''c:\\Program Files\\foo.txt'' is denied. (Errno::EACCES) From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:09 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Another way to simulate ?sudo? is to use an elevated Command Prompt. http://www.sevenforums.com/tutorials/11841-run-administrator.html tells you how. If you are using the command prompt a lot, you only need to deal with the UAC dialog box once when you open the elevated Command Prompt. After that, all commands executed from the Command Prompt run elevated. Jim, from an elevated Command prompt, I was able to create a new file in %ProgramFiles% using notepad, and did not get any UAC dialog box. This would mean that ?gem install? should also be able to install gems to %ProgramFiles%. Not sure how this reconciles with your comment about TrustedInstaller. Thibaut, could you try using ?igem install ?user-install?? (I wonder if IronRuby needs to catch the System.UnauthorizedAccessException exception and raise a Ruby exception for RubyGems to do the right thing.) Could you also separately try running from an elevated Command Prompt? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 9:18 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There are a couple of differences that would be apparent for this proposed solution: 1) Runas /user?. Is much longer than sudo ;) 2) The normal installation directory is owned by TrustedInstaller and Admins have no rights by default. We wouldn?t have a supported way to share gems at this time, since that does have security risks. Each user would have to install their own gems, but (unsupported) you should be able to move GEM_PATH (assuming we can figure out how to share between IronRuby and Ruby) to a shared location and change permissions on it. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green Sent: Tuesday, January 26, 2010 9:03 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Yes, that occurred to me this morning. ;-) So, runas /user:mymachine\administrator igem install foo for globals gems, right? -- Will Green http://hotgazpacho.org/ On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re <thibaut.barrere at gmail.com<mailto:thibaut.barrere at gmail.com>> wrote:> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as well as MRI on Linux, and I believe OS X, system-wide gems are > the default. This, of course, would require elevation (sudo gem install xxx).I believe per-user gems is now the default (it wasn''t in the past, but if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now installs gems into ~/.gem if GEM_HOME is not writable. Use --no-user-install command-line switch to disable this behavior.''). Here''s what happens on my machine (OS X): ~$ gem list | grep less ~$ sudo gem list | grep less ~$ gem install less (...) ~$ gem list | grep less less (1.2.21) ~$ sudo gem list | grep less (empty) ~$ gem -v 1.3.5 ~$ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/421c4828/attachment-0001.html>
Jim Deville
2010-Jan-26 20:09 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
Technically, the virtual store is an OS level feature, however, not using --user-install could imply to people that we are installing in a shared location when we aren?t. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 12:06 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Might be a .NET issue, but we should work around it in that case. What I am curious about though is if MRI is installed to Program Files, will ?gem install? also silently install to the virtual store if it is run without elevation. If the redirecting is done at the Ruby/OS level, then RubyGems does not need to do anything, and so ?user-install should not be needed at all. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 11:54 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Hm, that?s interesting? MRI gets redirected to the virtual store but IronRuby does not, I wonder if that is more of a .NET issue than a IronRuby problem? JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:44 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There indeed is a difference in behavior between IronRuby and MRI when creating a file in %ProgramFiles% from a non-elevated process. MRI silently writes to USERPROFILE. IronRuby raises Errno::EACCES. I have opened http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=3685 to track this. I don?t see the System.UnauthorizedAccessException though. D:\>ruby -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" D:\>dir "c:\Program Files\foo.txt" File Not Found D:\>dir "%USERPROFILE%\AppData\Local\VirtualStore\Program Files\foo.txt" 01/26/2010 11:39 AM 0 foo.txt 1 File(s) 0 bytes 0 Dir(s) 122,124,869,632 bytes free D:\>rbx -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" mscorlib:0:in `WinIOError'': Access to the path ''c:\\Program Files\\foo.txt'' is denied. (Errno::EACCES) From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:09 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Another way to simulate ?sudo? is to use an elevated Command Prompt. http://www.sevenforums.com/tutorials/11841-run-administrator.html tells you how. If you are using the command prompt a lot, you only need to deal with the UAC dialog box once when you open the elevated Command Prompt. After that, all commands executed from the Command Prompt run elevated. Jim, from an elevated Command prompt, I was able to create a new file in %ProgramFiles% using notepad, and did not get any UAC dialog box. This would mean that ?gem install? should also be able to install gems to %ProgramFiles%. Not sure how this reconciles with your comment about TrustedInstaller. Thibaut, could you try using ?igem install ?user-install?? (I wonder if IronRuby needs to catch the System.UnauthorizedAccessException exception and raise a Ruby exception for RubyGems to do the right thing.) Could you also separately try running from an elevated Command Prompt? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 9:18 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There are a couple of differences that would be apparent for this proposed solution: 1) Runas /user?. Is much longer than sudo ;) 2) The normal installation directory is owned by TrustedInstaller and Admins have no rights by default. We wouldn?t have a supported way to share gems at this time, since that does have security risks. Each user would have to install their own gems, but (unsupported) you should be able to move GEM_PATH (assuming we can figure out how to share between IronRuby and Ruby) to a shared location and change permissions on it. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green Sent: Tuesday, January 26, 2010 9:03 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Yes, that occurred to me this morning. ;-) So, runas /user:mymachine\administrator igem install foo for globals gems, right? -- Will Green http://hotgazpacho.org/ On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re <thibaut.barrere at gmail.com<mailto:thibaut.barrere at gmail.com>> wrote:> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as well as MRI on Linux, and I believe OS X, system-wide gems are > the default. This, of course, would require elevation (sudo gem install xxx).I believe per-user gems is now the default (it wasn''t in the past, but if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now installs gems into ~/.gem if GEM_HOME is not writable. Use --no-user-install command-line switch to disable this behavior.''). Here''s what happens on my machine (OS X): ~$ gem list | grep less ~$ sudo gem list | grep less ~$ gem install less (...) ~$ gem list | grep less less (1.2.21) ~$ sudo gem list | grep less (empty) ~$ gem -v 1.3.5 ~$ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/20bb417f/attachment-0001.html>
Shri Borde
2010-Jan-26 20:18 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
So how does RubyGems know that the target location is restricted? I can?t just call File.open and catch the exception. Perhaps it eagerly checks for permissions. So where does this leave us? Sounds like we can keep installing to ProgramFiles by default. Users can then run ?gem install? from an elevated Command Prompt if they want to share gems with other users, or they can use ?user-install if they prefer not to elevate. Sounds like we are good as is if Thibaut (or someone else) can confirm that ?user-install does work as expected. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 12:10 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Technically, the virtual store is an OS level feature, however, not using --user-install could imply to people that we are installing in a shared location when we aren?t. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 12:06 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Might be a .NET issue, but we should work around it in that case. What I am curious about though is if MRI is installed to Program Files, will ?gem install? also silently install to the virtual store if it is run without elevation. If the redirecting is done at the Ruby/OS level, then RubyGems does not need to do anything, and so ?user-install should not be needed at all. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 11:54 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Hm, that?s interesting? MRI gets redirected to the virtual store but IronRuby does not, I wonder if that is more of a .NET issue than a IronRuby problem? JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:44 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There indeed is a difference in behavior between IronRuby and MRI when creating a file in %ProgramFiles% from a non-elevated process. MRI silently writes to USERPROFILE. IronRuby raises Errno::EACCES. I have opened http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=3685 to track this. I don?t see the System.UnauthorizedAccessException though. D:\>ruby -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" D:\>dir "c:\Program Files\foo.txt" File Not Found D:\>dir "%USERPROFILE%\AppData\Local\VirtualStore\Program Files\foo.txt" 01/26/2010 11:39 AM 0 foo.txt 1 File(s) 0 bytes 0 Dir(s) 122,124,869,632 bytes free D:\>rbx -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" mscorlib:0:in `WinIOError'': Access to the path ''c:\\Program Files\\foo.txt'' is denied. (Errno::EACCES) From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:09 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Another way to simulate ?sudo? is to use an elevated Command Prompt. http://www.sevenforums.com/tutorials/11841-run-administrator.html tells you how. If you are using the command prompt a lot, you only need to deal with the UAC dialog box once when you open the elevated Command Prompt. After that, all commands executed from the Command Prompt run elevated. Jim, from an elevated Command prompt, I was able to create a new file in %ProgramFiles% using notepad, and did not get any UAC dialog box. This would mean that ?gem install? should also be able to install gems to %ProgramFiles%. Not sure how this reconciles with your comment about TrustedInstaller. Thibaut, could you try using ?igem install ?user-install?? (I wonder if IronRuby needs to catch the System.UnauthorizedAccessException exception and raise a Ruby exception for RubyGems to do the right thing.) Could you also separately try running from an elevated Command Prompt? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 9:18 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There are a couple of differences that would be apparent for this proposed solution: 1) Runas /user?. Is much longer than sudo ;) 2) The normal installation directory is owned by TrustedInstaller and Admins have no rights by default. We wouldn?t have a supported way to share gems at this time, since that does have security risks. Each user would have to install their own gems, but (unsupported) you should be able to move GEM_PATH (assuming we can figure out how to share between IronRuby and Ruby) to a shared location and change permissions on it. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green Sent: Tuesday, January 26, 2010 9:03 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Yes, that occurred to me this morning. ;-) So, runas /user:mymachine\administrator igem install foo for globals gems, right? -- Will Green http://hotgazpacho.org/ On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re <thibaut.barrere at gmail.com<mailto:thibaut.barrere at gmail.com>> wrote:> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as well as MRI on Linux, and I believe OS X, system-wide gems are > the default. This, of course, would require elevation (sudo gem install xxx).I believe per-user gems is now the default (it wasn''t in the past, but if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now installs gems into ~/.gem if GEM_HOME is not writable. Use --no-user-install command-line switch to disable this behavior.''). Here''s what happens on my machine (OS X): ~$ gem list | grep less ~$ sudo gem list | grep less ~$ gem install less (...) ~$ gem list | grep less less (1.2.21) ~$ sudo gem list | grep less (empty) ~$ gem -v 1.3.5 ~$ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/76bc9436/attachment-0001.html>
Jim Deville
2010-Jan-26 20:26 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
Got it. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 12:03 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) You have user error. Put the end-quote after foo.txt. You have it after Program Files. Notepad will try to open the folder, and that is causing the access-denied. Jimmy got the same error, but it went away after he moved the quote to the end. Notepad does prompt me to save to a different location if run from a non-elevated Command Prompt. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 11:36 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) [cid:image001.png at 01CA9E82.D906F790] That?s what happens when I do notepad ''C:\Program Files''\foo.txt from an elevated or unelevated command prompt. (If you don?t get the picture, it?s a dialog box that says ?Access is denied?). Have you modified your Program Files permissons? JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:09 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Another way to simulate ?sudo? is to use an elevated Command Prompt. http://www.sevenforums.com/tutorials/11841-run-administrator.html tells you how. If you are using the command prompt a lot, you only need to deal with the UAC dialog box once when you open the elevated Command Prompt. After that, all commands executed from the Command Prompt run elevated. Jim, from an elevated Command prompt, I was able to create a new file in %ProgramFiles% using notepad, and did not get any UAC dialog box. This would mean that ?gem install? should also be able to install gems to %ProgramFiles%. Not sure how this reconciles with your comment about TrustedInstaller. Thibaut, could you try using ?igem install ?user-install?? (I wonder if IronRuby needs to catch the System.UnauthorizedAccessException exception and raise a Ruby exception for RubyGems to do the right thing.) Could you also separately try running from an elevated Command Prompt? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 9:18 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There are a couple of differences that would be apparent for this proposed solution: 1) Runas /user?. Is much longer than sudo ;) 2) The normal installation directory is owned by TrustedInstaller and Admins have no rights by default. We wouldn?t have a supported way to share gems at this time, since that does have security risks. Each user would have to install their own gems, but (unsupported) you should be able to move GEM_PATH (assuming we can figure out how to share between IronRuby and Ruby) to a shared location and change permissions on it. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green Sent: Tuesday, January 26, 2010 9:03 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Yes, that occurred to me this morning. ;-) So, runas /user:mymachine\administrator igem install foo for globals gems, right? -- Will Green http://hotgazpacho.org/ On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re <thibaut.barrere at gmail.com<mailto:thibaut.barrere at gmail.com>> wrote:> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as well as MRI on Linux, and I believe OS X, system-wide gems are > the default. This, of course, would require elevation (sudo gem install xxx).I believe per-user gems is now the default (it wasn''t in the past, but if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now installs gems into ~/.gem if GEM_HOME is not writable. Use --no-user-install command-line switch to disable this behavior.''). Here''s what happens on my machine (OS X): ~$ gem list | grep less ~$ sudo gem list | grep less ~$ gem install less (...) ~$ gem list | grep less less (1.2.21) ~$ sudo gem list | grep less (empty) ~$ gem -v 1.3.5 ~$ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/bb783e28/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 3298 bytes Desc: image001.png URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/bb783e28/attachment-0001.png>
Shri Borde
2010-Jan-26 20:39 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
With RC1 (installed to Program Files by default), I was able to do ?igem install? from an elevated Command Prompt. From a normal prompt, ?igem install? failed with the System.UnauthorizedAccessException with or without ?user-install. We should track down why this is happening. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 12:18 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) So how does RubyGems know that the target location is restricted? I can?t just call File.open and catch the exception. Perhaps it eagerly checks for permissions. So where does this leave us? Sounds like we can keep installing to ProgramFiles by default. Users can then run ?gem install? from an elevated Command Prompt if they want to share gems with other users, or they can use ?user-install if they prefer not to elevate. Sounds like we are good as is if Thibaut (or someone else) can confirm that ?user-install does work as expected. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 12:10 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Technically, the virtual store is an OS level feature, however, not using --user-install could imply to people that we are installing in a shared location when we aren?t. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 12:06 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Might be a .NET issue, but we should work around it in that case. What I am curious about though is if MRI is installed to Program Files, will ?gem install? also silently install to the virtual store if it is run without elevation. If the redirecting is done at the Ruby/OS level, then RubyGems does not need to do anything, and so ?user-install should not be needed at all. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 11:54 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Hm, that?s interesting? MRI gets redirected to the virtual store but IronRuby does not, I wonder if that is more of a .NET issue than a IronRuby problem? JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:44 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There indeed is a difference in behavior between IronRuby and MRI when creating a file in %ProgramFiles% from a non-elevated process. MRI silently writes to USERPROFILE. IronRuby raises Errno::EACCES. I have opened http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=3685 to track this. I don?t see the System.UnauthorizedAccessException though. D:\>ruby -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" D:\>dir "c:\Program Files\foo.txt" File Not Found D:\>dir "%USERPROFILE%\AppData\Local\VirtualStore\Program Files\foo.txt" 01/26/2010 11:39 AM 0 foo.txt 1 File(s) 0 bytes 0 Dir(s) 122,124,869,632 bytes free D:\>rbx -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" mscorlib:0:in `WinIOError'': Access to the path ''c:\\Program Files\\foo.txt'' is denied. (Errno::EACCES) From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:09 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Another way to simulate ?sudo? is to use an elevated Command Prompt. http://www.sevenforums.com/tutorials/11841-run-administrator.html tells you how. If you are using the command prompt a lot, you only need to deal with the UAC dialog box once when you open the elevated Command Prompt. After that, all commands executed from the Command Prompt run elevated. Jim, from an elevated Command prompt, I was able to create a new file in %ProgramFiles% using notepad, and did not get any UAC dialog box. This would mean that ?gem install? should also be able to install gems to %ProgramFiles%. Not sure how this reconciles with your comment about TrustedInstaller. Thibaut, could you try using ?igem install ?user-install?? (I wonder if IronRuby needs to catch the System.UnauthorizedAccessException exception and raise a Ruby exception for RubyGems to do the right thing.) Could you also separately try running from an elevated Command Prompt? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 9:18 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There are a couple of differences that would be apparent for this proposed solution: 1) Runas /user?. Is much longer than sudo ;) 2) The normal installation directory is owned by TrustedInstaller and Admins have no rights by default. We wouldn?t have a supported way to share gems at this time, since that does have security risks. Each user would have to install their own gems, but (unsupported) you should be able to move GEM_PATH (assuming we can figure out how to share between IronRuby and Ruby) to a shared location and change permissions on it. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green Sent: Tuesday, January 26, 2010 9:03 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Yes, that occurred to me this morning. ;-) So, runas /user:mymachine\administrator igem install foo for globals gems, right? -- Will Green http://hotgazpacho.org/ On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re <thibaut.barrere at gmail.com<mailto:thibaut.barrere at gmail.com>> wrote:> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as well as MRI on Linux, and I believe OS X, system-wide gems are > the default. This, of course, would require elevation (sudo gem install xxx).I believe per-user gems is now the default (it wasn''t in the past, but if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now installs gems into ~/.gem if GEM_HOME is not writable. Use --no-user-install command-line switch to disable this behavior.''). Here''s what happens on my machine (OS X): ~$ gem list | grep less ~$ sudo gem list | grep less ~$ gem install less (...) ~$ gem list | grep less less (1.2.21) ~$ sudo gem list | grep less (empty) ~$ gem -v 1.3.5 ~$ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/e42eabc5/attachment-0001.html>
Shri Borde
2010-Jan-26 20:47 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
The following raises System.UnauthorizedAccessException with IronRuby, but works with MRI. require "fileutils" FileUtils.mkdir_p "c:/Program Files/foo" If we make this work with IronRuby or atleast throw Errno::EACCES, I think ?user-install will work from non-elevated prompt From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 12:40 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) With RC1 (installed to Program Files by default), I was able to do ?igem install? from an elevated Command Prompt. From a normal prompt, ?igem install? failed with the System.UnauthorizedAccessException with or without ?user-install. We should track down why this is happening. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 12:18 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) So how does RubyGems know that the target location is restricted? I can?t just call File.open and catch the exception. Perhaps it eagerly checks for permissions. So where does this leave us? Sounds like we can keep installing to ProgramFiles by default. Users can then run ?gem install? from an elevated Command Prompt if they want to share gems with other users, or they can use ?user-install if they prefer not to elevate. Sounds like we are good as is if Thibaut (or someone else) can confirm that ?user-install does work as expected. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 12:10 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Technically, the virtual store is an OS level feature, however, not using --user-install could imply to people that we are installing in a shared location when we aren?t. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 12:06 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Might be a .NET issue, but we should work around it in that case. What I am curious about though is if MRI is installed to Program Files, will ?gem install? also silently install to the virtual store if it is run without elevation. If the redirecting is done at the Ruby/OS level, then RubyGems does not need to do anything, and so ?user-install should not be needed at all. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 11:54 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Hm, that?s interesting? MRI gets redirected to the virtual store but IronRuby does not, I wonder if that is more of a .NET issue than a IronRuby problem? JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:44 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There indeed is a difference in behavior between IronRuby and MRI when creating a file in %ProgramFiles% from a non-elevated process. MRI silently writes to USERPROFILE. IronRuby raises Errno::EACCES. I have opened http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=3685 to track this. I don?t see the System.UnauthorizedAccessException though. D:\>ruby -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" D:\>dir "c:\Program Files\foo.txt" File Not Found D:\>dir "%USERPROFILE%\AppData\Local\VirtualStore\Program Files\foo.txt" 01/26/2010 11:39 AM 0 foo.txt 1 File(s) 0 bytes 0 Dir(s) 122,124,869,632 bytes free D:\>rbx -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" mscorlib:0:in `WinIOError'': Access to the path ''c:\\Program Files\\foo.txt'' is denied. (Errno::EACCES) From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde Sent: Tuesday, January 26, 2010 11:09 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Another way to simulate ?sudo? is to use an elevated Command Prompt. http://www.sevenforums.com/tutorials/11841-run-administrator.html tells you how. If you are using the command prompt a lot, you only need to deal with the UAC dialog box once when you open the elevated Command Prompt. After that, all commands executed from the Command Prompt run elevated. Jim, from an elevated Command prompt, I was able to create a new file in %ProgramFiles% using notepad, and did not get any UAC dialog box. This would mean that ?gem install? should also be able to install gems to %ProgramFiles%. Not sure how this reconciles with your comment about TrustedInstaller. Thibaut, could you try using ?igem install ?user-install?? (I wonder if IronRuby needs to catch the System.UnauthorizedAccessException exception and raise a Ruby exception for RubyGems to do the right thing.) Could you also separately try running from an elevated Command Prompt? From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville Sent: Tuesday, January 26, 2010 9:18 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) There are a couple of differences that would be apparent for this proposed solution: 1) Runas /user?. Is much longer than sudo ;) 2) The normal installation directory is owned by TrustedInstaller and Admins have no rights by default. We wouldn?t have a supported way to share gems at this time, since that does have security risks. Each user would have to install their own gems, but (unsupported) you should be able to move GEM_PATH (assuming we can figure out how to share between IronRuby and Ruby) to a shared location and change permissions on it. JD From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green Sent: Tuesday, January 26, 2010 9:03 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Yes, that occurred to me this morning. ;-) So, runas /user:mymachine\administrator igem install foo for globals gems, right? -- Will Green http://hotgazpacho.org/ On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re <thibaut.barrere at gmail.com<mailto:thibaut.barrere at gmail.com>> wrote:> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as well as MRI on Linux, and I believe OS X, system-wide gems are > the default. This, of course, would require elevation (sudo gem install xxx).I believe per-user gems is now the default (it wasn''t in the past, but if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now installs gems into ~/.gem if GEM_HOME is not writable. Use --no-user-install command-line switch to disable this behavior.''). Here''s what happens on my machine (OS X): ~$ gem list | grep less ~$ sudo gem list | grep less ~$ gem install less (...) ~$ gem list | grep less less (1.2.21) ~$ sudo gem list | grep less (empty) ~$ gem -v 1.3.5 ~$ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100126/f08b004a/attachment-0001.html>
Thibaut Barrère
2010-Jan-27 10:33 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
Hi, I''ll be able to do another test tomorrow if it''s still needed (is it ?), I''ll have access to my W7 machine then. On the whole thing: I believe that the newcomer, using a regular account, installing the MSI for IronRuby 1.0 (not RC) in the default provided path, should be able to use "igem install xxx" (on xp, vista, w7) without any specific tweak. I''m not saying that it''s easy to enable this though :), just that it will be the expected polish from people trying IR out, in my opinion. Is this behaviour the target ? -- Thibaut On Tue, Jan 26, 2010 at 9:47 PM, Shri Borde <Shri.Borde at microsoft.com> wrote:> The following raises System.UnauthorizedAccessException with IronRuby, but > works with MRI. > > > > require "fileutils" > > FileUtils.mkdir_p "c:/Program Files/foo" > > > > If we make this work with IronRuby or atleast throw Errno::EACCES, I think > ?user-install will work from non-elevated prompt > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde > Sent: Tuesday, January 26, 2010 12:40 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > With RC1 (installed to Program Files by default), I was able to do ?igem > install? from an elevated Command Prompt. > > > > From a normal prompt, ?igem install? failed with the > System.UnauthorizedAccessException with or without ?user-install. We should > track down why this is happening. > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde > Sent: Tuesday, January 26, 2010 12:18 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > So how does RubyGems know that the target location is restricted? I can?t > just call File.open and catch the exception. Perhaps it eagerly checks for > permissions. > > > > So where does this leave us? Sounds like we can keep installing to > ProgramFiles by default. Users can then run ?gem install? from an elevated > Command Prompt if they want to share gems with other users, or they can use > ?user-install if they prefer not to elevate. Sounds like we are good as is > if Thibaut (or someone else) can confirm that ?user-install does work as > expected. > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Tuesday, January 26, 2010 12:10 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Technically, the virtual store is an OS level feature, however, not using > --user-install could imply to people that we are installing in a shared > location when we aren?t. > > > > JD > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde > Sent: Tuesday, January 26, 2010 12:06 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Might be a .NET issue, but we should work around it in that case. > > > > What I am curious about though is if MRI is installed to Program Files, will > ?gem install? also silently install to the virtual store if it is run > without elevation. If the redirecting is done at the Ruby/OS level, then > RubyGems does not need to do anything, and so ?user-install should not be > needed at all. > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Tuesday, January 26, 2010 11:54 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Hm, that?s interesting? MRI gets redirected to the virtual store but > IronRuby does not, I wonder if that is more of a .NET issue than a IronRuby > problem? > > > > JD > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde > Sent: Tuesday, January 26, 2010 11:44 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > There indeed is a difference in behavior between IronRuby and MRI when > creating a file in %ProgramFiles% from a non-elevated process. MRI silently > writes to USERPROFILE. IronRuby raises Errno::EACCES. I have opened > http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=3685 to track > this. I don?t see the System.UnauthorizedAccessException though. > > > > D:\>ruby -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" > > > > D:\>dir "c:\Program Files\foo.txt" > > File Not Found > > > > D:\>dir "%USERPROFILE%\AppData\Local\VirtualStore\Program Files\foo.txt" > > 01/26/2010? 11:39 AM???????????????? 0 foo.txt > > ?????????????? 1 File(s)????????????? 0 bytes > > ?????????????? 0 Dir(s)? 122,124,869,632 bytes free > > > > D:\>rbx -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" > > mscorlib:0:in `WinIOError'': Access to the path ''c:\\Program Files\\foo.txt'' > is denied. (Errno::EACCES) > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde > Sent: Tuesday, January 26, 2010 11:09 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Another way to simulate ?sudo? is to use an elevated Command Prompt. > http://www.sevenforums.com/tutorials/11841-run-administrator.html tells you > how. If you are using the command prompt a lot, you only need to deal with > the UAC dialog box once when you open the elevated Command Prompt. After > that, all commands executed from the Command Prompt run elevated. > > > > Jim, from an elevated Command prompt, I was able to create a new file in > %ProgramFiles% using notepad, and did not get any UAC dialog box. This would > mean that ?gem install? should also be able to install gems to > %ProgramFiles%. Not sure how this reconciles with your comment about > TrustedInstaller. > > > > Thibaut, could you try using ?igem install ?user-install?? (I wonder if > IronRuby needs to catch the System.UnauthorizedAccessException exception and > raise a Ruby exception for RubyGems to do the right thing.) > > > > Could you also separately try running from an elevated Command Prompt? > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Tuesday, January 26, 2010 9:18 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > There are a couple of differences that would be apparent for this proposed > solution: > > 1)????? Runas /user?. Is much longer than sudo ;) > > 2)????? The normal installation directory is owned by TrustedInstaller and > Admins have no rights by default. We wouldn?t have a supported way to share > gems at this time, since that does have security risks. Each user would have > to install their own gems, but (unsupported) you should be able to move > GEM_PATH (assuming we can figure out how to share between IronRuby and Ruby) > to a shared location and change permissions on it. > > > > JD > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green > Sent: Tuesday, January 26, 2010 9:03 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Yes, that occurred to me this morning. ;-) > > > > So, runas /user:mymachine\administrator igem install foo for globals gems, > right? > > -- > Will Green > http://hotgazpacho.org/ > > On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re <thibaut.barrere at gmail.com> > wrote: > >> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as >> well as MRI on Linux, and I believe OS X, system-wide gems are >> the default. This, of course, would require elevation (sudo gem install >> xxx). > > I believe per-user gems is now the default (it wasn''t in the past, but > if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - > http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now > installs gems into ~/.gem if GEM_HOME is not writable. Use > --no-user-install command-line switch to disable this behavior.''). > > Here''s what happens on my machine (OS X): > > ~$ gem list | grep less > ~$ sudo gem list | grep less > ~$ gem install less > (...) > ~$ gem list | grep less > less (1.2.21) > ~$ sudo gem list | grep less > (empty) > > ~$ gem -v > 1.3.5 > ~$ ruby -v > ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] > > -- Thibaut > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >
Shri Borde
2010-Jan-27 18:26 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
With yesterday''s fix for System.UnauthorizedAccessException and another fix I will do today for File.basename, "igem install" works in either elevated or unelevated mode. In the former case, it will install to %ProgramFiles% allowing for sharing with other users. In the second mode, it falls back to installing to ~/.gems. This sounds like good behavior. -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Wednesday, January 27, 2010 2:34 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Hi, I''ll be able to do another test tomorrow if it''s still needed (is it ?), I''ll have access to my W7 machine then. On the whole thing: I believe that the newcomer, using a regular account, installing the MSI for IronRuby 1.0 (not RC) in the default provided path, should be able to use "igem install xxx" (on xp, vista, w7) without any specific tweak. I''m not saying that it''s easy to enable this though :), just that it will be the expected polish from people trying IR out, in my opinion. Is this behaviour the target ? -- Thibaut On Tue, Jan 26, 2010 at 9:47 PM, Shri Borde <Shri.Borde at microsoft.com> wrote:> The following raises System.UnauthorizedAccessException with IronRuby, but > works with MRI. > > > > require "fileutils" > > FileUtils.mkdir_p "c:/Program Files/foo" > > > > If we make this work with IronRuby or atleast throw Errno::EACCES, I think > -user-install will work from non-elevated prompt > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde > Sent: Tuesday, January 26, 2010 12:40 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > With RC1 (installed to Program Files by default), I was able to do "igem > install" from an elevated Command Prompt. > > > > From a normal prompt, "igem install" failed with the > System.UnauthorizedAccessException with or without -user-install. We should > track down why this is happening. > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde > Sent: Tuesday, January 26, 2010 12:18 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > So how does RubyGems know that the target location is restricted? I can''t > just call File.open and catch the exception. Perhaps it eagerly checks for > permissions. > > > > So where does this leave us? Sounds like we can keep installing to > ProgramFiles by default. Users can then run "gem install" from an elevated > Command Prompt if they want to share gems with other users, or they can use > -user-install if they prefer not to elevate. Sounds like we are good as is > if Thibaut (or someone else) can confirm that -user-install does work as > expected. > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Tuesday, January 26, 2010 12:10 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Technically, the virtual store is an OS level feature, however, not using > --user-install could imply to people that we are installing in a shared > location when we aren''t. > > > > JD > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde > Sent: Tuesday, January 26, 2010 12:06 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Might be a .NET issue, but we should work around it in that case. > > > > What I am curious about though is if MRI is installed to Program Files, will > "gem install" also silently install to the virtual store if it is run > without elevation. If the redirecting is done at the Ruby/OS level, then > RubyGems does not need to do anything, and so -user-install should not be > needed at all. > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Tuesday, January 26, 2010 11:54 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Hm, that''s interesting. MRI gets redirected to the virtual store but > IronRuby does not, I wonder if that is more of a .NET issue than a IronRuby > problem. > > > > JD > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde > Sent: Tuesday, January 26, 2010 11:44 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > There indeed is a difference in behavior between IronRuby and MRI when > creating a file in %ProgramFiles% from a non-elevated process. MRI silently > writes to USERPROFILE. IronRuby raises Errno::EACCES. I have opened > http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=3685 to track > this. I don''t see the System.UnauthorizedAccessException though. > > > > D:\>ruby -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" > > > > D:\>dir "c:\Program Files\foo.txt" > > File Not Found > > > > D:\>dir "%USERPROFILE%\AppData\Local\VirtualStore\Program Files\foo.txt" > > 01/26/2010? 11:39 AM???????????????? 0 foo.txt > > ?????????????? 1 File(s)????????????? 0 bytes > > ?????????????? 0 Dir(s)? 122,124,869,632 bytes free > > > > D:\>rbx -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" > > mscorlib:0:in `WinIOError'': Access to the path ''c:\\Program Files\\foo.txt'' > is denied. (Errno::EACCES) > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde > Sent: Tuesday, January 26, 2010 11:09 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Another way to simulate "sudo" is to use an elevated Command Prompt. > http://www.sevenforums.com/tutorials/11841-run-administrator.html tells you > how. If you are using the command prompt a lot, you only need to deal with > the UAC dialog box once when you open the elevated Command Prompt. After > that, all commands executed from the Command Prompt run elevated. > > > > Jim, from an elevated Command prompt, I was able to create a new file in > %ProgramFiles% using notepad, and did not get any UAC dialog box. This would > mean that "gem install" should also be able to install gems to > %ProgramFiles%. Not sure how this reconciles with your comment about > TrustedInstaller. > > > > Thibaut, could you try using "igem install -user-install"? (I wonder if > IronRuby needs to catch the System.UnauthorizedAccessException exception and > raise a Ruby exception for RubyGems to do the right thing.) > > > > Could you also separately try running from an elevated Command Prompt? > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Tuesday, January 26, 2010 9:18 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > There are a couple of differences that would be apparent for this proposed > solution: > > 1)????? Runas /user.. Is much longer than sudo ;) > > 2)????? The normal installation directory is owned by TrustedInstaller and > Admins have no rights by default. We wouldn''t have a supported way to share > gems at this time, since that does have security risks. Each user would have > to install their own gems, but (unsupported) you should be able to move > GEM_PATH (assuming we can figure out how to share between IronRuby and Ruby) > to a shared location and change permissions on it. > > > > JD > > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green > Sent: Tuesday, January 26, 2010 9:03 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Yes, that occurred to me this morning. ;-) > > > > So, runas /user:mymachine\administrator igem install foo for globals gems, > right? > > -- > Will Green > http://hotgazpacho.org/ > > On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re <thibaut.barrere at gmail.com> > wrote: > >> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as >> well as MRI on Linux, and I believe OS X, system-wide gems are >> the default. This, of course, would require elevation (sudo gem install >> xxx). > > I believe per-user gems is now the default (it wasn''t in the past, but > if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - > http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now > installs gems into ~/.gem if GEM_HOME is not writable. Use > --no-user-install command-line switch to disable this behavior.''). > > Here''s what happens on my machine (OS X): > > ~$ gem list | grep less > ~$ sudo gem list | grep less > ~$ gem install less > (...) > ~$ gem list | grep less > less (1.2.21) > ~$ sudo gem list | grep less > (empty) > > ~$ gem -v > 1.3.5 > ~$ ruby -v > ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] > > -- Thibaut > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >_______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
Thibaut Barrère
2010-Jan-29 08:58 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
> > With yesterday''s fix for System.UnauthorizedAccessException and another fix > I will do today for File.basename, "igem install" works in either elevated > or unelevated mode. In the former case, it will install to %ProgramFiles% > allowing for sharing with other users. In the second mode, it falls back to > installing to ~/.gems. This sounds like good behavior. >yep - sounds perfect. I''ll be able to do more test once the new MSI is pushed out. thanks for the discussion and fixes :) -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100129/80811fe4/attachment.html>
Will Green
2010-Jan-29 17:40 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
In MRI, when you attempt to gem install, but don''t have access to the system gems path, you get a warning before putting them in ~/.gems Is this behavior preserved for IronRuby? -- Will Green http://hotgazpacho.org/ On Wed, Jan 27, 2010 at 1:26 PM, Shri Borde <Shri.Borde at microsoft.com>wrote:> With yesterday''s fix for System.UnauthorizedAccessException and another fix > I will do today for File.basename, "igem install" works in either elevated > or unelevated mode. In the former case, it will install to %ProgramFiles% > allowing for sharing with other users. In the second mode, it falls back to > installing to ~/.gems. This sounds like good behavior. > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re > Sent: Wednesday, January 27, 2010 2:34 AM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > Hi, > > I''ll be able to do another test tomorrow if it''s still needed (is it > ?), I''ll have access to my W7 machine then. > > On the whole thing: I believe that the newcomer, using a regular > account, installing the MSI for IronRuby 1.0 (not RC) in the default > provided path, should be able to use "igem install xxx" (on xp, vista, > w7) without any specific tweak. > > I''m not saying that it''s easy to enable this though :), just that it > will be the expected polish from people trying IR out, in my opinion. > > Is this behaviour the target ? > > -- Thibaut > > > On Tue, Jan 26, 2010 at 9:47 PM, Shri Borde <Shri.Borde at microsoft.com> > wrote: > > The following raises System.UnauthorizedAccessException with IronRuby, > but > > works with MRI. > > > > > > > > require "fileutils" > > > > FileUtils.mkdir_p "c:/Program Files/foo" > > > > > > > > If we make this work with IronRuby or atleast throw Errno::EACCES, I > think > > -user-install will work from non-elevated prompt > > > > > > > > From: ironruby-core-bounces at rubyforge.org > > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde > > Sent: Tuesday, January 26, 2010 12:40 PM > > To: ironruby-core at rubyforge.org > > Subject: Re: [Ironruby-core] "igem install rake" raise an > > System.UnauthorizedAccessException (Windows 7) > > > > > > > > With RC1 (installed to Program Files by default), I was able to do "igem > > install" from an elevated Command Prompt. > > > > > > > > From a normal prompt, "igem install" failed with the > > System.UnauthorizedAccessException with or without -user-install. We > should > > track down why this is happening. > > > > > > > > From: ironruby-core-bounces at rubyforge.org > > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde > > Sent: Tuesday, January 26, 2010 12:18 PM > > To: ironruby-core at rubyforge.org > > Subject: Re: [Ironruby-core] "igem install rake" raise an > > System.UnauthorizedAccessException (Windows 7) > > > > > > > > So how does RubyGems know that the target location is restricted? I can''t > > just call File.open and catch the exception. Perhaps it eagerly checks > for > > permissions. > > > > > > > > So where does this leave us? Sounds like we can keep installing to > > ProgramFiles by default. Users can then run "gem install" from an > elevated > > Command Prompt if they want to share gems with other users, or they can > use > > -user-install if they prefer not to elevate. Sounds like we are good as > is > > if Thibaut (or someone else) can confirm that -user-install does work as > > expected. > > > > > > > > From: ironruby-core-bounces at rubyforge.org > > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville > > Sent: Tuesday, January 26, 2010 12:10 PM > > To: ironruby-core at rubyforge.org > > Subject: Re: [Ironruby-core] "igem install rake" raise an > > System.UnauthorizedAccessException (Windows 7) > > > > > > > > Technically, the virtual store is an OS level feature, however, not using > > --user-install could imply to people that we are installing in a shared > > location when we aren''t. > > > > > > > > JD > > > > > > > > From: ironruby-core-bounces at rubyforge.org > > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde > > Sent: Tuesday, January 26, 2010 12:06 PM > > To: ironruby-core at rubyforge.org > > Subject: Re: [Ironruby-core] "igem install rake" raise an > > System.UnauthorizedAccessException (Windows 7) > > > > > > > > Might be a .NET issue, but we should work around it in that case. > > > > > > > > What I am curious about though is if MRI is installed to Program Files, > will > > "gem install" also silently install to the virtual store if it is run > > without elevation. If the redirecting is done at the Ruby/OS level, then > > RubyGems does not need to do anything, and so -user-install should not be > > needed at all. > > > > > > > > From: ironruby-core-bounces at rubyforge.org > > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville > > Sent: Tuesday, January 26, 2010 11:54 AM > > To: ironruby-core at rubyforge.org > > Subject: Re: [Ironruby-core] "igem install rake" raise an > > System.UnauthorizedAccessException (Windows 7) > > > > > > > > Hm, that''s interesting. MRI gets redirected to the virtual store but > > IronRuby does not, I wonder if that is more of a .NET issue than a > IronRuby > > problem. > > > > > > > > JD > > > > > > > > From: ironruby-core-bounces at rubyforge.org > > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde > > Sent: Tuesday, January 26, 2010 11:44 AM > > To: ironruby-core at rubyforge.org > > Subject: Re: [Ironruby-core] "igem install rake" raise an > > System.UnauthorizedAccessException (Windows 7) > > > > > > > > There indeed is a difference in behavior between IronRuby and MRI when > > creating a file in %ProgramFiles% from a non-elevated process. MRI > silently > > writes to USERPROFILE. IronRuby raises Errno::EACCES. I have opened > > http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=3685 to track > > this. I don''t see the System.UnauthorizedAccessException though. > > > > > > > > D:\>ruby -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" > > > > > > > > D:\>dir "c:\Program Files\foo.txt" > > > > File Not Found > > > > > > > > D:\>dir "%USERPROFILE%\AppData\Local\VirtualStore\Program Files\foo.txt" > > > > 01/26/2010 11:39 AM 0 foo.txt > > > > 1 File(s) 0 bytes > > > > 0 Dir(s) 122,124,869,632 bytes free > > > > > > > > D:\>rbx -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" > > > > mscorlib:0:in `WinIOError'': Access to the path ''c:\\Program > Files\\foo.txt'' > > is denied. (Errno::EACCES) > > > > > > > > From: ironruby-core-bounces at rubyforge.org > > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Shri Borde > > Sent: Tuesday, January 26, 2010 11:09 AM > > To: ironruby-core at rubyforge.org > > Subject: Re: [Ironruby-core] "igem install rake" raise an > > System.UnauthorizedAccessException (Windows 7) > > > > > > > > Another way to simulate "sudo" is to use an elevated Command Prompt. > > http://www.sevenforums.com/tutorials/11841-run-administrator.html tells > you > > how. If you are using the command prompt a lot, you only need to deal > with > > the UAC dialog box once when you open the elevated Command Prompt. After > > that, all commands executed from the Command Prompt run elevated. > > > > > > > > Jim, from an elevated Command prompt, I was able to create a new file in > > %ProgramFiles% using notepad, and did not get any UAC dialog box. This > would > > mean that "gem install" should also be able to install gems to > > %ProgramFiles%. Not sure how this reconciles with your comment about > > TrustedInstaller. > > > > > > > > Thibaut, could you try using "igem install -user-install"? (I wonder if > > IronRuby needs to catch the System.UnauthorizedAccessException exception > and > > raise a Ruby exception for RubyGems to do the right thing.) > > > > > > > > Could you also separately try running from an elevated Command Prompt? > > > > > > > > From: ironruby-core-bounces at rubyforge.org > > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville > > Sent: Tuesday, January 26, 2010 9:18 AM > > To: ironruby-core at rubyforge.org > > Subject: Re: [Ironruby-core] "igem install rake" raise an > > System.UnauthorizedAccessException (Windows 7) > > > > > > > > There are a couple of differences that would be apparent for this > proposed > > solution: > > > > 1) Runas /user.. Is much longer than sudo ;) > > > > 2) The normal installation directory is owned by TrustedInstaller > and > > Admins have no rights by default. We wouldn''t have a supported way to > share > > gems at this time, since that does have security risks. Each user would > have > > to install their own gems, but (unsupported) you should be able to move > > GEM_PATH (assuming we can figure out how to share between IronRuby and > Ruby) > > to a shared location and change permissions on it. > > > > > > > > JD > > > > > > > > From: ironruby-core-bounces at rubyforge.org > > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green > > Sent: Tuesday, January 26, 2010 9:03 AM > > To: ironruby-core at rubyforge.org > > Subject: Re: [Ironruby-core] "igem install rake" raise an > > System.UnauthorizedAccessException (Windows 7) > > > > > > > > Yes, that occurred to me this morning. ;-) > > > > > > > > So, runas /user:mymachine\administrator igem install foo for globals > gems, > > right? > > > > -- > > Will Green > > http://hotgazpacho.org/ > > > > On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re < > thibaut.barrere at gmail.com> > > wrote: > > > >> Per-user gems should not be the default. In RubyInstaller (mingw MRI), > as > >> well as MRI on Linux, and I believe OS X, system-wide gems are > >> the default. This, of course, would require elevation (sudo gem install > >> xxx). > > > > I believe per-user gems is now the default (it wasn''t in the past, but > > if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - > > http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now > > installs gems into ~/.gem if GEM_HOME is not writable. Use > > --no-user-install command-line switch to disable this behavior.''). > > > > Here''s what happens on my machine (OS X): > > > > ~$ gem list | grep less > > ~$ sudo gem list | grep less > > ~$ gem install less > > (...) > > ~$ gem list | grep less > > less (1.2.21) > > ~$ sudo gem list | grep less > > (empty) > > > > ~$ gem -v > > 1.3.5 > > ~$ ruby -v > > ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] > > > > -- Thibaut > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > > > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100129/4be0843d/attachment-0001.html>
Shri Borde
2010-Jan-29 18:25 UTC
[Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7)
Yup, it is. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Will Green Sent: Friday, January 29, 2010 9:40 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) In MRI, when you attempt to gem install, but don''t have access to the system gems path, you get a warning before putting them in ~/.gems Is this behavior preserved for IronRuby? -- Will Green http://hotgazpacho.org/ On Wed, Jan 27, 2010 at 1:26 PM, Shri Borde <Shri.Borde at microsoft.com<mailto:Shri.Borde at microsoft.com>> wrote: With yesterday''s fix for System.UnauthorizedAccessException and another fix I will do today for File.basename, "igem install" works in either elevated or unelevated mode. In the former case, it will install to %ProgramFiles% allowing for sharing with other users. In the second mode, it falls back to installing to ~/.gems. This sounds like good behavior. -----Original Message----- From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Thibaut Barr?re Sent: Wednesday, January 27, 2010 2:34 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: Re: [Ironruby-core] "igem install rake" raise an System.UnauthorizedAccessException (Windows 7) Hi, I''ll be able to do another test tomorrow if it''s still needed (is it ?), I''ll have access to my W7 machine then. On the whole thing: I believe that the newcomer, using a regular account, installing the MSI for IronRuby 1.0 (not RC) in the default provided path, should be able to use "igem install xxx" (on xp, vista, w7) without any specific tweak. I''m not saying that it''s easy to enable this though :), just that it will be the expected polish from people trying IR out, in my opinion. Is this behaviour the target ? -- Thibaut On Tue, Jan 26, 2010 at 9:47 PM, Shri Borde <Shri.Borde at microsoft.com<mailto:Shri.Borde at microsoft.com>> wrote:> The following raises System.UnauthorizedAccessException with IronRuby, but > works with MRI. > > > > require "fileutils" > > FileUtils.mkdir_p "c:/Program Files/foo" > > > > If we make this work with IronRuby or atleast throw Errno::EACCES, I think > -user-install will work from non-elevated prompt > > > > From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> > [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Shri Borde > Sent: Tuesday, January 26, 2010 12:40 PM > To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > With RC1 (installed to Program Files by default), I was able to do "igem > install" from an elevated Command Prompt. > > > > From a normal prompt, "igem install" failed with the > System.UnauthorizedAccessException with or without -user-install. We should > track down why this is happening. > > > > From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> > [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Shri Borde > Sent: Tuesday, January 26, 2010 12:18 PM > To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > So how does RubyGems know that the target location is restricted? I can''t > just call File.open and catch the exception. Perhaps it eagerly checks for > permissions. > > > > So where does this leave us? Sounds like we can keep installing to > ProgramFiles by default. Users can then run "gem install" from an elevated > Command Prompt if they want to share gems with other users, or they can use > -user-install if they prefer not to elevate. Sounds like we are good as is > if Thibaut (or someone else) can confirm that -user-install does work as > expected. > > > > From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> > [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Jim Deville > Sent: Tuesday, January 26, 2010 12:10 PM > To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Technically, the virtual store is an OS level feature, however, not using > --user-install could imply to people that we are installing in a shared > location when we aren''t. > > > > JD > > > > From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> > [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Shri Borde > Sent: Tuesday, January 26, 2010 12:06 PM > To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Might be a .NET issue, but we should work around it in that case. > > > > What I am curious about though is if MRI is installed to Program Files, will > "gem install" also silently install to the virtual store if it is run > without elevation. If the redirecting is done at the Ruby/OS level, then > RubyGems does not need to do anything, and so -user-install should not be > needed at all. > > > > From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> > [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Jim Deville > Sent: Tuesday, January 26, 2010 11:54 AM > To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Hm, that''s interesting. MRI gets redirected to the virtual store but > IronRuby does not, I wonder if that is more of a .NET issue than a IronRuby > problem. > > > > JD > > > > From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> > [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Shri Borde > Sent: Tuesday, January 26, 2010 11:44 AM > To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > There indeed is a difference in behavior between IronRuby and MRI when > creating a file in %ProgramFiles% from a non-elevated process. MRI silently > writes to USERPROFILE. IronRuby raises Errno::EACCES. I have opened > http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=3685 to track > this. I don''t see the System.UnauthorizedAccessException though. > > > > D:\>ruby -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" > > > > D:\>dir "c:\Program Files\foo.txt" > > File Not Found > > > > D:\>dir "%USERPROFILE%\AppData\Local\VirtualStore\Program Files\foo.txt" > > 01/26/2010 11:39 AM 0 foo.txt > > 1 File(s) 0 bytes > > 0 Dir(s) 122,124,869,632 bytes free > > > > D:\>rbx -e "File.open(''c:/Program Files/foo.txt'', ''w+'') {}" > > mscorlib:0:in `WinIOError'': Access to the path ''c:\\Program Files\\foo.txt'' > is denied. (Errno::EACCES) > > > > From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> > [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Shri Borde > Sent: Tuesday, January 26, 2010 11:09 AM > To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Another way to simulate "sudo" is to use an elevated Command Prompt. > http://www.sevenforums.com/tutorials/11841-run-administrator.html tells you > how. If you are using the command prompt a lot, you only need to deal with > the UAC dialog box once when you open the elevated Command Prompt. After > that, all commands executed from the Command Prompt run elevated. > > > > Jim, from an elevated Command prompt, I was able to create a new file in > %ProgramFiles% using notepad, and did not get any UAC dialog box. This would > mean that "gem install" should also be able to install gems to > %ProgramFiles%. Not sure how this reconciles with your comment about > TrustedInstaller. > > > > Thibaut, could you try using "igem install -user-install"? (I wonder if > IronRuby needs to catch the System.UnauthorizedAccessException exception and > raise a Ruby exception for RubyGems to do the right thing.) > > > > Could you also separately try running from an elevated Command Prompt? > > > > From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> > [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Jim Deville > Sent: Tuesday, January 26, 2010 9:18 AM > To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > There are a couple of differences that would be apparent for this proposed > solution: > > 1) Runas /user.. Is much longer than sudo ;) > > 2) The normal installation directory is owned by TrustedInstaller and > Admins have no rights by default. We wouldn''t have a supported way to share > gems at this time, since that does have security risks. Each user would have > to install their own gems, but (unsupported) you should be able to move > GEM_PATH (assuming we can figure out how to share between IronRuby and Ruby) > to a shared location and change permissions on it. > > > > JD > > > > From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> > [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Will Green > Sent: Tuesday, January 26, 2010 9:03 AM > To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> > Subject: Re: [Ironruby-core] "igem install rake" raise an > System.UnauthorizedAccessException (Windows 7) > > > > Yes, that occurred to me this morning. ;-) > > > > So, runas /user:mymachine\administrator igem install foo for globals gems, > right? > > -- > Will Green > http://hotgazpacho.org/ > > On Tue, Jan 26, 2010 at 4:16 AM, Thibaut Barr?re <thibaut.barrere at gmail.com<mailto:thibaut.barrere at gmail.com>> > wrote: > >> Per-user gems should not be the default. In RubyInstaller (mingw MRI), as >> well as MRI on Linux, and I believe OS X, system-wide gems are >> the default. This, of course, would require elevation (sudo gem install >> xxx). > > I believe per-user gems is now the default (it wasn''t in the past, but > if I''m right a rubygems update changed that behaviour. Maybe 1.3.0 - > http://rubyforge.org/forum/forum.php?forum_id=27728 => ''RubyGems now > installs gems into ~/.gem if GEM_HOME is not writable. Use > --no-user-install command-line switch to disable this behavior.''). > > Here''s what happens on my machine (OS X): > > ~$ gem list | grep less > ~$ sudo gem list | grep less > ~$ gem install less > (...) > ~$ gem list | grep less > less (1.2.21) > ~$ sudo gem list | grep less > (empty) > > ~$ gem -v > 1.3.5 > ~$ ruby -v > ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] > > -- Thibaut > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> > http://rubyforge.org/mailman/listinfo/ironruby-core > >_______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100129/0672d792/attachment-0001.html>