Is rexml/document compatible with IronRuby? I am running the following
code:
and it throws me the exception:
require ''rexml/document''
include REXML
class EnvironmentSetupService
def setupEnvironment(connectionString)
# open the file
file = File.open(''../../Web.config'',''w+'')
doc = Document.new(file)
puts doc.root
end
end
Unhandled Exception: IronRuby.Builtins.LoadError: no such file to load
-- rexml/
document
at
Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame
fram
e)
at
Microsoft.Scripting.Interpreter.Interpreter.RunInstructions(InterpretedFra
me frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame
frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0
arg0, T1 a
rg1)
at IronRuby.Runtime.RubyScriptCode.Run(Scope scope, Boolean
bindGlobals)
at IronRuby.Runtime.RubyScriptCode.Run(Scope scope)
at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink
errorSink)
at Microsoft.Scripting.SourceUnit.Execute(Scope scope)
at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope
scope)
at Microsoft.Scripting.Hosting.ScriptEngine.ExecuteFile(String path,
ScriptSc
ope scope)
at Microsoft.Scripting.Hosting.ScriptEngine.ExecuteFile(String path)
at ConsoleApplication2.Program.Main(String[] args) in
C:\Projects\EStudyVS200
8\EStudySoltution\EStudy\ConsoleApplication2\Program.cs:line 18
Press any key to continue . . .
--
Posted via http://www.ruby-forum.com/.
> Is rexml/document compatible with IronRuby?Yes: >>> require ''rexml/document'' => true What is the value of $LOAD_PATH? I had sent you a mail earlier saying to copy ir.exe.config and put it in your application''s app.config, and to correct any relative paths in the LibraryPaths value. Not being able to find rexml means that the Ruby standard library isn''t on your $LOAD_PATH, or your application doesn''t have permissions to see it. If you have questions about a library being supported, please try it through ir.exe; if it works then you know it''s a problem with your hosting setup. ~Jimmy
I thought this path mess was cleaned in the IronRuby RC version. I have the "bin" folder path in my environment variable. I can execute the ruby implemention of the rexml/document without any problems. But when I try to do the same using C# invoking IronRuby it throws exceptions. -- Posted via http://www.ruby-forum.com/.
Even with the release version, you need to make your app.exe.config have the right xml elements to setup the load path. JD -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Mohammad Azam Sent: Friday, January 15, 2010 10:20 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] rexml/document with IronRuby I thought this path mess was cleaned in the IronRuby RC version. I have the "bin" folder path in my environment variable. I can execute the ruby implemention of the rexml/document without any problems. But when I try to do the same using C# invoking IronRuby it throws exceptions. -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
Will this be changed in the final release!! This configuration, setting different paths etc is too much a hassle for developers. -- Posted via http://www.ruby-forum.com/.
> This configuration, setting different paths etc is too much a hassle for developers.Let''s go over what "configuration, setting different paths etc" actually means: - When using ir.exe directly? Nothing, the Ruby standard library just works. - When embedding IronRuby inside a .NET app? Just telling your C# app where IronRuby''s libraries are: 1. Copy ir.exe.config into your app.config 2. Make sure LibraryPaths still make sense. Making these full-paths is easiest, So just replace the ".." with "C:\IronRuby" (or wherever you extracted a IronRuby release to ... for example this is the LibraryPaths for a C:\IronRuby installation: C:\IronRuby\lib\IronRuby;C:\IronRuby\lib\ruby\site_ruby\1.8;C:\IronRuby\lib\ruby\site_ruby;C:\IronRuby\lib\ruby\1.8 And that''s it. So please, let me know how this could be too much hassle for you. Sure, embedding isn''t "one-click", but don''t blow it up to be more than it really is. Please let us know if you''ve found any real ship-stopping bugs. Note that ir.exe.config uses relative paths as we have no idea where someone will unzip the release to. With the MSI we can possibly generate ir.exe.config to use full paths, but that would be very low on our list of stuff to do for 1.0. Also, if we release VS integration in the future, generating the correct app.config for embedding is also a possibility. However, for embedding, presumably you are going to want to put the libraries into your application''s directory, so you do really care about where the paths are, which is why we don''t somehow magically find them. ~Jimmy
To further the point, adding elements to your config should be a fairly routine task, as it is also required by data access, WCF, and other libraries. Some of those may have tooling, but you must edit the config in some way. So I don''t see this as quite an incredulous thing to ask. Ryan Riley On Fri, Jan 15, 2010 at 1:09 PM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote:> > This configuration, setting different paths etc is too much a hassle for > developers. > > Let''s go over what "configuration, setting different paths etc" actually > means: > > - When using ir.exe directly? > > Nothing, the Ruby standard library just works. > > - When embedding IronRuby inside a .NET app? > > Just telling your C# app where IronRuby''s libraries are: > 1. Copy ir.exe.config into your app.config > 2. Make sure LibraryPaths still make sense. Making these full-paths is > easiest, > So just replace the ".." with "C:\IronRuby" (or wherever you extracted > a IronRuby > release to ... for example this is the LibraryPaths for a C:\IronRuby > installation: > > C:\IronRuby\lib\IronRuby;C:\IronRuby\lib\ruby\site_ruby\1.8;C:\IronRuby\lib\ruby\site_ruby;C:\IronRuby\lib\ruby\1.8 > > And that''s it. So please, let me know how this could be too much hassle for > you. > Sure, embedding isn''t "one-click", but don''t blow it up to be more than it > really is. > Please let us know if you''ve found any real ship-stopping bugs. > > Note that ir.exe.config uses relative paths as we have no idea where > someone will > unzip the release to. With the MSI we can possibly generate ir.exe.config > to use > full paths, but that would be very low on our list of stuff to do for 1.0. > Also, > if we release VS integration in the future, generating the correct > app.config > for embedding is also a possibility. > > However, for embedding, presumably you are going to want to put the > libraries > into your application''s directory, so you do really care about where the > paths > are, which is why we don''t somehow magically find them. > > ~Jimmy > > > > _______________________________________________ > 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/20100115/711eeae6/attachment.html>
When I presented on IronRuby at different events and showed people how much they have to do in order to get the thing in working state they nudge their head and says no thanks. Developers are already drained under configuration and now they have to remember this one more configuration. Setting up environment variables, pasting code from ir.exe.config into personal config settings. This is too much work for a developer. Not to mention that this has to be done on every dev machine. Yes, I can make a batch file which can inject the settings into environment and config but then this is another thing to maintain and dev nightmare. -- Posted via http://www.ruby-forum.com/.
BTW, I like to mention that I love IronRuby. The above post is the feedback I received from the audience who were in my "I Love IronRuby" session. -- Posted via http://www.ruby-forum.com/.
While I agree that changing the app.config is a common task, and it''s easy if you''re just shipping a single standalone app, it''s a giant pain in the ass if you''re having to upgrade an existing installation, or integrate with another program. (Outlook.exe.config anyone??) I''ve seen a fair few .net apps move their configuration OUT of app.config and into the registry because of things like that. Is there a way that we can set the library path and other such things programatically (eg: RubyEngine.LoadPath = "blah"), etc? That would be much nicer than app.config mangling :-( Cheers, Orion On 16/01/2010, at 8:09 AM, Jimmy Schementi wrote:>> This configuration, setting different paths etc is too much a hassle for developers. > > Let''s go over what "configuration, setting different paths etc" actually means: > > - When using ir.exe directly? > > Nothing, the Ruby standard library just works. > > - When embedding IronRuby inside a .NET app? > > Just telling your C# app where IronRuby''s libraries are: > 1. Copy ir.exe.config into your app.config > 2. Make sure LibraryPaths still make sense. Making these full-paths is easiest, > So just replace the ".." with "C:\IronRuby" (or wherever you extracted a IronRuby > release to ... for example this is the LibraryPaths for a C:\IronRuby installation: > C:\IronRuby\lib\IronRuby;C:\IronRuby\lib\ruby\site_ruby\1.8;C:\IronRuby\lib\ruby\site_ruby;C:\IronRuby\lib\ruby\1.8 > > And that''s it. So please, let me know how this could be too much hassle for you. > Sure, embedding isn''t "one-click", but don''t blow it up to be more than it really is. > Please let us know if you''ve found any real ship-stopping bugs. > > Note that ir.exe.config uses relative paths as we have no idea where someone will > unzip the release to. With the MSI we can possibly generate ir.exe.config to use > full paths, but that would be very low on our list of stuff to do for 1.0. Also, > if we release VS integration in the future, generating the correct app.config > for embedding is also a possibility. > > However, for embedding, presumably you are going to want to put the libraries > into your application''s directory, so you do really care about where the paths > are, which is why we don''t somehow magically find them. > > ~Jimmy > > > > _______________________________________________ > 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/20100116/e950c467/attachment-0001.html>
The worst thing about WCF is all the configuration! Just because everything else sucks it doesn''t mean that it''s ok for us to suck too! At least you can configure WCF programatically. Along the same lines, it would be nice for IronRuby to offer a programmatic option also (if it already does, then hooray!) On 16/01/2010, at 8:34 AM, Ryan Riley wrote:> To further the point, adding elements to your config should be a fairly routine task, as it is also required by data access, WCF, and other libraries. Some of those may have tooling, but you must edit the config in some way. So I don''t see this as quite an incredulous thing to ask. > > > Ryan Riley > > > On Fri, Jan 15, 2010 at 1:09 PM, Jimmy Schementi <Jimmy.Schementi at microsoft.com> wrote: > > This configuration, setting different paths etc is too much a hassle for developers. > > Let''s go over what "configuration, setting different paths etc" actually means: > > - When using ir.exe directly? > > Nothing, the Ruby standard library just works. > > - When embedding IronRuby inside a .NET app? > > Just telling your C# app where IronRuby''s libraries are: > 1. Copy ir.exe.config into your app.config > 2. Make sure LibraryPaths still make sense. Making these full-paths is easiest, > So just replace the ".." with "C:\IronRuby" (or wherever you extracted a IronRuby > release to ... for example this is the LibraryPaths for a C:\IronRuby installation: > C:\IronRuby\lib\IronRuby;C:\IronRuby\lib\ruby\site_ruby\1.8;C:\IronRuby\lib\ruby\site_ruby;C:\IronRuby\lib\ruby\1.8 > > And that''s it. So please, let me know how this could be too much hassle for you. > Sure, embedding isn''t "one-click", but don''t blow it up to be more than it really is. > Please let us know if you''ve found any real ship-stopping bugs. > > Note that ir.exe.config uses relative paths as we have no idea where someone will > unzip the release to. With the MSI we can possibly generate ir.exe.config to use > full paths, but that would be very low on our list of stuff to do for 1.0. Also, > if we release VS integration in the future, generating the correct app.config > for embedding is also a possibility. > > However, for embedding, presumably you are going to want to put the libraries > into your application''s directory, so you do really care about where the paths > are, which is why we don''t somehow magically find them. > > ~Jimmy > > > > _______________________________________________ > 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/20100116/6fd7a51b/attachment.html>
I don''t remember the exact command, but there is a method...
SetupSearchPath or something like that (it''s on my computer which needs
to charge).
JD
________________________________
From: Orion Edwards <orion.edwards at gmail.com>
Sent: Friday, January 15, 2010 9:52 PM
To: ironruby-core at rubyforge.org <ironruby-core at rubyforge.org>
Subject: Re: [Ironruby-core] rexml/document with IronRuby
While I agree that changing the app.config is a common task, and it''s
easy if you''re just shipping a single standalone app, it''s a
giant pain in the ass if you''re having to upgrade an existing
installation, or integrate with another program. (Outlook.exe.config anyone??)
I''ve seen a fair few .net apps move their configuration OUT of
app.config and into the registry because of things like that.
Is there a way that we can set the library path and other such things
programatically (eg: RubyEngine.LoadPath = "blah"), etc? That would be
much nicer than app.config mangling :-(
Cheers, Orion
On 16/01/2010, at 8:09 AM, Jimmy Schementi wrote:
This configuration, setting different paths etc is too much a hassle for
developers.
Let''s go over what "configuration, setting different paths
etc" actually means:
- When using ir.exe directly?
Nothing, the Ruby standard library just works.
- When embedding IronRuby inside a .NET app?
Just telling your C# app where IronRuby''s libraries are:
1. Copy ir.exe.config into your app.config
2. Make sure LibraryPaths still make sense. Making these full-paths is easiest,
So just replace the ".." with "C:\IronRuby" (or wherever
you extracted a IronRuby
release to ... for example this is the LibraryPaths for a C:\IronRuby
installation:
C:\IronRuby\lib\IronRuby;C:\IronRuby\lib\ruby\site_ruby\1.8;C:\IronRuby\lib\ruby\site_ruby;C:\IronRuby\lib\ruby\1.8
And that''s it. So please, let me know how this could be too much hassle
for you.
Sure, embedding isn''t "one-click", but don''t blow it
up to be more than it really is.
Please let us know if you''ve found any real ship-stopping bugs.
Note that ir.exe.config uses relative paths as we have no idea where someone
will
unzip the release to. With the MSI we can possibly generate ir.exe.config to use
full paths, but that would be very low on our list of stuff to do for 1.0. Also,
if we release VS integration in the future, generating the correct app.config
for embedding is also a possibility.
However, for embedding, presumably you are going to want to put the libraries
into your application''s directory, so you do really care about where
the paths
are, which is why we don''t somehow magically find them.
~Jimmy
_______________________________________________
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/20100116/cc80ba5c/attachment.html>
You can change all that from code as well.
ScriptRuntimeSetup is what you''re interested in
http://github.com/casualjim/ironrubymvc/blob/master/IronRubyMvc/Core/RubyEngine.cs#L412
You can add load paths too from C#
http://github.com/casualjim/ironrubymvc/blob/master/IronRubyMvc/Core/RubyEngine.cs#L365
Adding stuff to the registry is always wrong IMO. The reason being that the
registry only exists on windows and maybe for you that isn''t a problem.
In
european governments it''s not allowed to use windows for many of the
applications (I''m sure most of you know about the great relationship
between
the EU and MSFT) so they run linux with mono. In my country that amounts to
about 30% of the entire IT infrastructure/employment. The config problem is
a trivial problem at best, and I don''t think this issue is ironruby
specific.
Deploying stuff with registry keys almost forces you to use an installer,
which makes the process of scripting the installation of an entire
environment less than optimal for example ( I don''t do system images
because
they get stale and are bound to specific hardware).
I could do a long rant on this subject, but in comparison to 95% of the
software I get to deal with in an enterprise environment has at least 5x the
configuration requirements from IronRuby. Let''s look at this closer
this
whole thread is about < 10 f''ing lines of XML.
Less than 10 lines people, have you ever set up
asp.netmvc/WCF/windsor/unity/....? So I think instead of complaining
you should be
happy with what the IronRuby team accomplished.
Would you rather have the default values hard-coded then, because
that''s
such a great solution <sarcasm/>?
<configSections>
<section name=''microsoft.scripting''
requirePermission=''false''
type=''Microsoft.Scripting.Hosting.Configuration.Section,
Microsoft.Scripting, Version=0.9.6.20, Culture=neutral,
PublicKeyToken=null''/>
</configSections>
<microsoft.scripting>
<languages>
<language extensions=''.py''
displayName=''IronPython 2.6''
type=''IronPython.Runtime.PythonContext, IronPython,
Version=2.6.10920.0,
Culture=neutral, PublicKeyToken=null''
names=''IronPython;Python;py''/>
<language extensions=''.rb''
displayName=''IronRuby''
type=''IronRuby.Runtime.RubyContext, IronRuby, Version=0.9.3.0,
Culture=neutral, PublicKeyToken=null''
names=''IronRuby;Ruby;rb''/>
</languages>
<options>
<set language=''Ruby''
option=''LibraryPaths''
value=''..\lib\IronRuby;..\lib\ruby\site_ruby\1.8;..\lib\ruby\site_ruby;..\lib\ruby\1.8''/>
</options>
</microsoft.scripting>
---
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 Sat, Jan 16, 2010 at 6:46 AM, Orion Edwards <orion.edwards at
gmail.com>wrote:
> While I agree that changing the app.config is a common task, and
it''s easy
> if you''re just shipping a single standalone app, it''s a
*giant* pain in
> the ass if you''re having to upgrade an existing installation, or
integrate
> with another program. (Outlook.exe.config anyone??)
> I''ve seen a fair few .net apps move their configuration OUT of
app.config
> and into the registry because of things like that.
>
> Is there a way that we can set the library path and other such things
> programatically (eg: RubyEngine.LoadPath = "blah"), etc? That
would be much
> nicer than app.config mangling :-(
>
> Cheers, Orion
>
>
>
> On 16/01/2010, at 8:09 AM, Jimmy Schementi wrote:
>
> This configuration, setting different paths etc is too much a hassle for
> developers.
>
>
> Let''s go over what "configuration, setting different paths
etc" actually
> means:
>
> - When using ir.exe directly?
>
> Nothing, the Ruby standard library just works.
>
> - When embedding IronRuby inside a .NET app?
>
> Just telling your C# app where IronRuby''s libraries are:
> 1. Copy ir.exe.config into your app.config
> 2. Make sure LibraryPaths still make sense. Making these full-paths is
> easiest,
> So just replace the ".." with "C:\IronRuby" (or
wherever you extracted
> a IronRuby
> release to ... for example this is the LibraryPaths for a C:\IronRuby
> installation:
>
>
C:\IronRuby\lib\IronRuby;C:\IronRuby\lib\ruby\site_ruby\1.8;C:\IronRuby\lib\ruby\site_ruby;C:\IronRuby\lib\ruby\1.8
>
> And that''s it. So please, let me know how this could be too much
hassle for
> you.
> Sure, embedding isn''t "one-click", but don''t
blow it up to be more than it
> really is.
> Please let us know if you''ve found any real ship-stopping bugs.
>
> Note that ir.exe.config uses relative paths as we have no idea where
> someone will
> unzip the release to. With the MSI we can possibly generate ir.exe.config
> to use
> full paths, but that would be very low on our list of stuff to do for 1.0.
> Also,
> if we release VS integration in the future, generating the correct
> app.config
> for embedding is also a possibility.
>
> However, for embedding, presumably you are going to want to put the
> libraries
> into your application''s directory, so you do really care about
where the
> paths
> are, which is why we don''t somehow magically find them.
>
> ~Jimmy
>
>
>
> _______________________________________________
> 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/20100116/5d7c17b7/attachment-0001.html>
ScriptEngine.SetSearchPaths does it for search paths.
A configuration file is just one of the options how to configure IronRuby. The
most general API is Ruby.CreateRuntime(ScriptRuntimeSetup), where you provide a
configuration object. In fact, the parameter-less Ruby.CreateRuntime and
Ruby.CreateEngine just call
Ruby.CreateRuntime(ScriptRuntimeSetup.ReadConfiguration()). You can write your
own configuration system that produces ScriptRuntimeSetup instance from
registry, MEF, yaml files, server on the Internet, or any other data provider.
Tomas
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Jim Deville
Sent: Friday, January 15, 2010 10:15 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] rexml/document with IronRuby
I don''t remember the exact command, but there is a method...
SetupSearchPath or something like that (it''s on my computer which needs
to charge).
JD
________________________________
From: Orion Edwards <orion.edwards at gmail.com>
Sent: Friday, January 15, 2010 9:52 PM
To: ironruby-core at rubyforge.org <ironruby-core at rubyforge.org>
Subject: Re: [Ironruby-core] rexml/document with IronRuby
While I agree that changing the app.config is a common task, and it''s
easy if you''re just shipping a single standalone app, it''s a
giant pain in the ass if you''re having to upgrade an existing
installation, or integrate with another program. (Outlook.exe.config anyone??)
I''ve seen a fair few .net apps move their configuration OUT of
app.config and into the registry because of things like that.
Is there a way that we can set the library path and other such things
programatically (eg: RubyEngine.LoadPath = "blah"), etc? That would be
much nicer than app.config mangling :-(
Cheers, Orion
On 16/01/2010, at 8:09 AM, Jimmy Schementi wrote:
This configuration, setting different paths etc is too much a hassle for
developers.
Let''s go over what "configuration, setting different paths
etc" actually means:
- When using ir.exe directly?
Nothing, the Ruby standard library just works.
- When embedding IronRuby inside a .NET app?
Just telling your C# app where IronRuby''s libraries are:
1. Copy ir.exe.config into your app.config
2. Make sure LibraryPaths still make sense. Making these full-paths is easiest,
So just replace the ".." with "C:\IronRuby" (or wherever
you extracted a IronRuby
release to ... for example this is the LibraryPaths for a C:\IronRuby
installation:
C:\IronRuby\lib\IronRuby;C:\IronRuby\lib\ruby\site_ruby\1.8;C:\IronRuby\lib\ruby\site_ruby;C:\IronRuby\lib\ruby\1.8
And that''s it. So please, let me know how this could be too much hassle
for you.
Sure, embedding isn''t "one-click", but don''t blow it
up to be more than it really is.
Please let us know if you''ve found any real ship-stopping bugs.
Note that ir.exe.config uses relative paths as we have no idea where someone
will
unzip the release to. With the MSI we can possibly generate ir.exe.config to use
full paths, but that would be very low on our list of stuff to do for 1.0. Also,
if we release VS integration in the future, generating the correct app.config
for embedding is also a possibility.
However, for embedding, presumably you are going to want to put the libraries
into your application''s directory, so you do really care about where
the paths
are, which is why we don''t somehow magically find them.
~Jimmy
_______________________________________________
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/20100116/e0f67ef1/attachment.html>
BTW: I don''t see how moving configuration from .config file to registry
helps anything. There is an API for updating .config files as there is an API
for updating registry.
When integrating with another .NET program you just insert IronRuby/DLR specific
section into the existing .config file and you''re done. Outlook
isn''t a managed app and thus hosts CLR via native hosting APIs. In that
case it''s up to the host how it manages configuration. You can always
load a configuration file yourself if the host doesn''t do it for you.
See
http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.aspx
API.
Tomas
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Orion Edwards
Sent: Friday, January 15, 2010 9:47 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] rexml/document with IronRuby
While I agree that changing the app.config is a common task, and it''s
easy if you''re just shipping a single standalone app, it''s a
giant pain in the ass if you''re having to upgrade an existing
installation, or integrate with another program. (Outlook.exe.config anyone??)
I''ve seen a fair few .net apps move their configuration OUT of
app.config and into the registry because of things like that.
Is there a way that we can set the library path and other such things
programatically (eg: RubyEngine.LoadPath = "blah"), etc? That would be
much nicer than app.config mangling :-(
Cheers, Orion
On 16/01/2010, at 8:09 AM, Jimmy Schementi wrote:
This configuration, setting different paths etc is too much a hassle for
developers.
Let''s go over what "configuration, setting different paths
etc" actually means:
- When using ir.exe directly?
Nothing, the Ruby standard library just works.
- When embedding IronRuby inside a .NET app?
Just telling your C# app where IronRuby''s libraries are:
1. Copy ir.exe.config into your app.config
2. Make sure LibraryPaths still make sense. Making these full-paths is easiest,
So just replace the ".." with "C:\IronRuby" (or wherever
you extracted a IronRuby
release to ... for example this is the LibraryPaths for a C:\IronRuby
installation:
C:\IronRuby\lib\IronRuby;C:\IronRuby\lib\ruby\site_ruby\1.8;C:\IronRuby\lib\ruby\site_ruby;C:\IronRuby\lib\ruby\1.8
And that''s it. So please, let me know how this could be too much hassle
for you.
Sure, embedding isn''t "one-click", but don''t blow it
up to be more than it really is.
Please let us know if you''ve found any real ship-stopping bugs.
Note that ir.exe.config uses relative paths as we have no idea where someone
will
unzip the release to. With the MSI we can possibly generate ir.exe.config to use
full paths, but that would be very low on our list of stuff to do for 1.0. Also,
if we release VS integration in the future, generating the correct app.config
for embedding is also a possibility.
However, for embedding, presumably you are going to want to put the libraries
into your application''s directory, so you do really care about where
the paths
are, which is why we don''t somehow magically find them.
~Jimmy
_______________________________________________
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/20100116/43f742ac/attachment.html>
var scriptingRuntime = IronRuby.Ruby.CreateRuntime();
var engine = scriptingRuntime.GetEngine("rb");
var operations = engine.CreateOperations();
var paths = new List<String>();
paths.Add(@"C:\ironruby\ironruby\Merlin\Main\Languages\Ruby\Libs");
paths.Add(@"C:\ironruby\ironruby\Merlin\External.LCA_RESTRICTED\Languages\Ruby\redist-libs\ruby\1.8");
engine.SetSearchPaths(paths);
--
Posted via http://www.ruby-forum.com/.
Sweet :-) What can I say, I''ve just had some bad experiences with app.config files in the past. Apologies for the rantish tone I took the other day Thanks, Orion On 16/01/2010, at 8:02 PM, Tomas Matousek wrote:> ScriptEngine.SetSearchPaths does it for search paths. > > A configuration file is just one of the options how to configure IronRuby. The most general API is Ruby.CreateRuntime(ScriptRuntimeSetup), where you provide a configuration object. In fact, the parameter-less Ruby.CreateRuntime and Ruby.CreateEngine just call Ruby.CreateRuntime(ScriptRuntimeSetup.ReadConfiguration()). You can write your own configuration system that produces ScriptRuntimeSetup instance from registry, MEF, yaml files, server on the Internet, or any other data provider. > > Tomas > > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Jim Deville > Sent: Friday, January 15, 2010 10:15 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] rexml/document with IronRuby > > I don''t remember the exact command, but there is a method... SetupSearchPath or something like that (it''s on my computer which needs to charge). > > JD > > > > From: Orion Edwards <orion.edwards at gmail.com> > Sent: Friday, January 15, 2010 9:52 PM > To: ironruby-core at rubyforge.org <ironruby-core at rubyforge.org> > Subject: Re: [Ironruby-core] rexml/document with IronRuby > > While I agree that changing the app.config is a common task, and it''s easy if you''re just shipping a single standalone app, it''s a giant pain in the ass if you''re having to upgrade an existing installation, or integrate with another program. (Outlook.exe.config anyone??) > I''ve seen a fair few .net apps move their configuration OUT of app.config and into the registry because of things like that. > > Is there a way that we can set the library path and other such things programatically (eg: RubyEngine.LoadPath = "blah"), etc? That would be much nicer than app.config mangling :-( > > Cheers, Orion > > > On 16/01/2010, at 8:09 AM, Jimmy Schementi wrote: > > > This configuration, setting different paths etc is too much a hassle for developers. > > Let''s go over what "configuration, setting different paths etc" actually means: > > - When using ir.exe directly? > > Nothing, the Ruby standard library just works. > > - When embedding IronRuby inside a .NET app? > > Just telling your C# app where IronRuby''s libraries are: > 1. Copy ir.exe.config into your app.config > 2. Make sure LibraryPaths still make sense. Making these full-paths is easiest, > So just replace the ".." with "C:\IronRuby" (or wherever you extracted a IronRuby > release to ... for example this is the LibraryPaths for a C:\IronRuby installation: > C:\IronRuby\lib\IronRuby;C:\IronRuby\lib\ruby\site_ruby\1.8;C:\IronRuby\lib\ruby\site_ruby;C:\IronRuby\lib\ruby\1.8 > > And that''s it. So please, let me know how this could be too much hassle for you. > Sure, embedding isn''t "one-click", but don''t blow it up to be more than it really is. > Please let us know if you''ve found any real ship-stopping bugs. > > Note that ir.exe.config uses relative paths as we have no idea where someone will > unzip the release to. With the MSI we can possibly generate ir.exe.config to use > full paths, but that would be very low on our list of stuff to do for 1.0. Also, > if we release VS integration in the future, generating the correct app.config > for embedding is also a possibility. > > However, for embedding, presumably you are going to want to put the libraries > into your application''s directory, so you do really care about where the paths > are, which is why we don''t somehow magically find them. > > ~Jimmy > > > > _______________________________________________ > 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/20100117/d2eacfc1/attachment.html>