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
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

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 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).

  1.  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: [email protected]
[mailto:[email protected]] On Behalf Of Chris Ortman
Sent: Tuesday, April 27, 2010 6:45 AM
To: [email protected]
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
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

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 S.
Sent: Tuesday, April 27, 2010 11:34 AM
To: [email protected]
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: [email protected]
[mailto:[email protected]] On Behalf Of Tomas M.
Sent: Tuesday, April 27, 2010 10:53 AM
To: [email protected]
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 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).

  1.  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: [email protected]
[mailto:[email protected]] On Behalf Of Chris Ortman
Sent: Tuesday, April 27, 2010 6:45 AM
To: [email protected]
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
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

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 S. <

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: [email protected]
[mailto:[email protected]] On Behalf Of Tomas M.
Sent: Tuesday, April 27, 2010 10:53 AM
To: [email protected]
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 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).

  1.  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: [email protected]
[mailto:[email protected]] On Behalf Of Chris Ortman
Sent: Tuesday, April 27, 2010 6:45 AM
To: [email protected]
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
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

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

| Privacy Policy | Terms of Service | Remote Ruby Jobs