I am playing around with ir + rails and using it in front of a bunch of existing .NET code. The .NET code really really wants a couple of settings in <appSettings> When i run via script/server though the app.config file is ir.exe.config (AppDomain.Current.SetupInformation.ConfigurationFile)... is there a way to override what config file is loaded? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100427/d4cea9b9/attachment.html>
A couple of options here. 1) Use/create a .NET executable with app.config file. One option is to copy ir.exe to the root directory of your app and add ir.exe.config with appSettings that you need. Don''t forget to change Ruby library paths in that ir.exe.config file. You''ll also need to copy the rest of the assemblies from IronRuby bin directory to the same directory as ir.exe (or some subdirectory that you specify in <probing> element of ir.exe.config, see http://msdn.microsoft.com/en-us/library/823z9h8w(VS.80).aspx) or to the GAC (using gacutil.exe: http://msdn.microsoft.com/en-us/library/ex0ss12c(VS.80).aspx). 2) Create an AppDomain that is set up to use the right config file: http://msdn.microsoft.com/en-us/library/system.appdomainsetup.configurationfile(v=VS.100).aspx. Then launch the entire rails application (script/server) in that AppDomain. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Chris Ortman Sent: Tuesday, April 27, 2010 6:45 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] app.config file in a rails app I am playing around with ir + rails and using it in front of a bunch of existing .NET code. The .NET code really really wants a couple of settings in <appSettings> When i run via script/server though the app.config file is ir.exe.config (AppDomain.Current.SetupInformation.ConfigurationFile)... is there a way to override what config file is loaded? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100427/974c72f2/attachment.html>
You could do that, but is your eventual goal to actually deploy the app? If so I''d suggest using IronRuby.Rack (http://github.com/ironruby/ironruby/tree/master/Merlin/Main/Hosts/IronRuby.Rack) which lets you run Rails on ASP.NET webservers (IIS, for example). It requires that you have a web.config in your application, so you could put settings in there. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek Sent: Tuesday, April 27, 2010 10:53 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] app.config file in a rails app A couple of options here. 1) Use/create a .NET executable with app.config file. One option is to copy ir.exe to the root directory of your app and add ir.exe.config with appSettings that you need. Don''t forget to change Ruby library paths in that ir.exe.config file. You''ll also need to copy the rest of the assemblies from IronRuby bin directory to the same directory as ir.exe (or some subdirectory that you specify in <probing> element of ir.exe.config, see http://msdn.microsoft.com/en-us/library/823z9h8w(VS.80).aspx) or to the GAC (using gacutil.exe: http://msdn.microsoft.com/en-us/library/ex0ss12c(VS.80).aspx). 2) Create an AppDomain that is set up to use the right config file: http://msdn.microsoft.com/en-us/library/system.appdomainsetup.configurationfile(v=VS.100).aspx. Then launch the entire rails application (script/server) in that AppDomain. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Chris Ortman Sent: Tuesday, April 27, 2010 6:45 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] app.config file in a rails app I am playing around with ir + rails and using it in front of a bunch of existing .NET code. The .NET code really really wants a couple of settings in <appSettings> When i run via script/server though the app.config file is ir.exe.config (AppDomain.Current.SetupInformation.ConfigurationFile)... is there a way to override what config file is loaded? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100427/f957f29d/attachment.html>
Here''s a better link: http://ironruby.net/Documentation/Real_Ruby_Applications/Rails#webserver-production ... it''ll be where other info about deploying Rails will be, and now has a screencast showing how to build IronRuby.Rack. ~js From: Jimmy Schementi Sent: Tuesday, April 27, 2010 11:34 AM To: ironruby-core at rubyforge.org Subject: RE: [Ironruby-core] app.config file in a rails app You could do that, but is your eventual goal to actually deploy the app? If so I''d suggest using IronRuby.Rack (http://github.com/ironruby/ironruby/tree/master/Merlin/Main/Hosts/IronRuby.Rack) which lets you run Rails on ASP.NET webservers (IIS, for example). It requires that you have a web.config in your application, so you could put settings in there. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek Sent: Tuesday, April 27, 2010 10:53 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] app.config file in a rails app A couple of options here. 1) Use/create a .NET executable with app.config file. One option is to copy ir.exe to the root directory of your app and add ir.exe.config with appSettings that you need. Don''t forget to change Ruby library paths in that ir.exe.config file. You''ll also need to copy the rest of the assemblies from IronRuby bin directory to the same directory as ir.exe (or some subdirectory that you specify in <probing> element of ir.exe.config, see http://msdn.microsoft.com/en-us/library/823z9h8w(VS.80).aspx) or to the GAC (using gacutil.exe: http://msdn.microsoft.com/en-us/library/ex0ss12c(VS.80).aspx). 2) Create an AppDomain that is set up to use the right config file: http://msdn.microsoft.com/en-us/library/system.appdomainsetup.configurationfile(v=VS.100).aspx. Then launch the entire rails application (script/server) in that AppDomain. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Chris Ortman Sent: Tuesday, April 27, 2010 6:45 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] app.config file in a rails app I am playing around with ir + rails and using it in front of a bunch of existing .NET code. The .NET code really really wants a couple of settings in <appSettings> When i run via script/server though the app.config file is ir.exe.config (AppDomain.Current.SetupInformation.ConfigurationFile)... is there a way to override what config file is loaded? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100427/4c93fd97/attachment-0001.html>
I went with the rack based approach. Took me a few tries to get right, but works slick once it is set up. Thanks a bunch On Tue, Apr 27, 2010 at 1:33 PM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote:> You could do that, but is your eventual goal to actually deploy the app? If > so I?d suggest using IronRuby.Rack ( > http://github.com/ironruby/ironruby/tree/master/Merlin/Main/Hosts/IronRuby.Rack) > which lets you run Rails on ASP.NET webservers (IIS, for example). It > requires that you have a web.config in your application, so you could put > settings in there. > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Tomas Matousek > *Sent:* Tuesday, April 27, 2010 10:53 AM > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] app.config file in a rails app > > > > A couple of options here. > > 1) Use/create a .NET executable with app.config file. One option is > to copy ir.exe to the root directory of your app and add ir.exe.config with > appSettings that you need. Don?t forget to change Ruby library paths in that > ir.exe.config file. You?ll also need to copy the rest of the assemblies from > IronRuby bin directory to the same directory as ir.exe (or some subdirectory > that you specify in <probing> element of ir.exe.config, see > http://msdn.microsoft.com/en-us/library/823z9h8w(VS.80).aspx) or to the > GAC (using gacutil.exe: > http://msdn.microsoft.com/en-us/library/ex0ss12c(VS.80).aspx). > > 2) Create an AppDomain that is set up to use the right config file: > http://msdn.microsoft.com/en-us/library/system.appdomainsetup.configurationfile(v=VS.100).aspx. > Then launch the entire rails application (script/server) in that AppDomain. > > > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Chris Ortman > *Sent:* Tuesday, April 27, 2010 6:45 AM > *To:* ironruby-core at rubyforge.org > *Subject:* [Ironruby-core] app.config file in a rails app > > > > I am playing around with ir + rails and using it in front of a bunch of > existing .NET code. > > The .NET code really really wants a couple of settings in <appSettings> > > When i run via script/server though the app.config file is ir.exe.config > (AppDomain.Current.SetupInformation.ConfigurationFile)... is there a way to > override what config file is loaded? > > > > Thanks > > _______________________________________________ > 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/20100429/d6414f35/attachment.html>