# Open-Uri Path in App.Config

**URL:** <https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327>\
**Category:** IronRuby\
**Created:** [March 1, 2010, 2:21am UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327 "2010-03-01T02:21:33Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 2:21am UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/1 "2010-03-01T02:21:33Z")

</div>

I completely forgot the paths that I need to setup to use open-uri in  
IronRuby when using with C#. I need to put those paths in my App.config  
to work with open-uri. Can anyone please paste those sections here? I  
keep forgetting those sections that I need to include in my App.config.

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 6:30am UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/2 "2010-03-01T06:30:20Z")

</div>

I guess you’re talking about that:

## Shay.

Shay F. | .NET Technologies Expert | Author of IronRuby Unleashed  
|  
Sela Technology Center  
Blog: [http://IronShay.com](http://IronShay.com) | Twitter: [http://twitter.com/ironshay](http://twitter.com/ironshay)

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 3:25pm UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/3 "2010-03-01T15:25:42Z")

</div>

So, I added the paths that you provided in my C# code since I am trying  
to execute the .rb file from C#. Here is the complete code:

static void Main(string[] args)  
{  
var url = “[http://www.google.com.com](http://www.google.com.com)”;

```
        var engine = IronRuby.Ruby.CreateEngine();
        var scope = engine.ExecuteFile("../../screenscraper.rb");

        var paths = new List<String>();
        paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib");
        paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib\ruby\site_ruby\1.8");
        paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib\ruby\site_ruby");
        paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib\ruby\1.8");

        engine.SetSearchPaths(paths);

        var obj = 

```

engine.Runtime.Globals.GetVariable(“ScreenScraper”);

```
        var screenScraper = engine.Operations.CreateInstance(obj);

        var html = engine.Operations.InvokeMember(screenScraper, 

```

“scrape”, url);

```
        Console.WriteLine(html);

    }

```

When I run the application I get the following error:

Unhandled Exception: IronRuby.Builtins.LoadError: no such file to load  
– open-u  
ri  
at  
Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame  
fram  
e)  
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.Hosting.ScriptSource.Execute(ScriptScope  
scope)  
at Microsoft.Scripting.Hosting.ScriptEngine.ExecuteFile(String path)  
at IronRubyConsoleApp.Program.Main(String[] args) in  
C:\Projects\ILoveIronRub  
y\ILoveIronRuby\IronRubyConsoleApp\Program.cs:line 15  
Press any key to continue . . .

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 9:44am UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/4 "2010-03-01T09:44:02Z")

</div>

Is this still an issue?

Provide a config file like this:

\<?xml version='1.0' encoding='UTF-8'?\> 

\<microsoft.scripting\>

```
<options>
  <set language='Ruby' option='LibraryPaths'

```

value=‘C:\ironruby\lib\IronRuby;C:\ironruby\lib\ruby\site\_ruby\1.8;C:\ironruby\lib\ruby\site\_ruby;C:\ironruby\lib\ruby\1.8’/\>  
  
\</microsoft.scripting\>

Host IronRuby like this:

var setup = ScriptRuntimeSetup.ReadConfiguration();  
scriptRuntime = Ruby.CreateRuntime(setup);  
Engine = Ruby.GetEngine(Runtime);  
Context = Ruby.GetExecutionContext(Engine);  
// You can use Context.Loader.SetLoadPaths(IEnumerable paths) to  
replace the load paths at run-time

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 3:37pm UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/5 "2010-03-01T15:37:35Z")

</div>

you might want to move the executefile method

var url = “[http://www.google.com.com](http://www.google.com.com)”;

```
       var engine = IronRuby.Ruby.CreateEngine();

       var paths = new List<String>();
       paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib");

```

paths.Add(@“C:\DevTools\ironruby-1.0-rc1\lib\ruby\site\_ruby\1.8”);  
paths.Add(@“C:\DevTools\ironruby-1.0-rc1\lib\ruby\site\_ruby”);  
paths.Add(@“C:\DevTools\ironruby-1.0-rc1\lib\ruby\1.8”);

```
       engine.SetSearchPaths(paths);

       var obj =

```

engine.Runtime.Globals.GetVariable(“ScreenScraper”);  
engine.ExecuteFile(“…/…/screenscraper.rb”);  
var screenScraper = engine.Operations.CreateInstance(obj);

```
       var html = engine.Operations.InvokeMember(screenScraper,

```

“scrape”, url);

```
       Console.WriteLine(html);

```

* * *

Met vriendelijke groeten - Best regards - Salutations  
Ivan Porto C. - Mob: +32.486.787.582  
Web: [http://whiterabbitconsulting.eu](http://whiterabbitconsulting.eu) - [http://flanders.co.nz](http://flanders.co.nz)  
Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
Author of IronRuby in Action ([http://manning.com/carrero](http://manning.com/carrero))  
Microsoft IronRuby/C# MVP

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 4:21pm UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/6 "2010-03-01T16:21:54Z")

</div>

Here is my implementation:

static void Main(string args)  
{  
var url = “[http://www.google.com](http://www.google.com)”;

```
        var engine = IronRuby.Ruby.CreateEngine();

        var paths = new List<String>();
        paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib");
        paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib\ruby\site_ruby\1.8");
        paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib\ruby\site_ruby");
        paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib\ruby\1.8");

        engine.SetSearchPaths(paths);

        engine.ExecuteFile("../../screenscraper.rb");
        var obj = 

```

engine.Runtime.Globals.GetVariable(“ScreenScraper”);

```
        var screenScraper = engine.Operations.CreateInstance(obj);

        var html = engine.Operations.InvokeMember(screenScraper, 

```

“scrape”, url);

```
        Console.WriteLine(html);

    }

```

And now it throws the following error:

Unhandled Exception: IronRuby.Builtins.LoadError: no such file to load  
– string  
io  
at  
Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame  
fram  
e)  
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.Hosting.ScriptSource.Execute(ScriptScope  
scope)  
at Microsoft.Scripting.Hosting.ScriptEngine.ExecuteFile(String path)  
at IronRubyConsoleApp.Program.Main(String args) in  
C:\Projects\ILoveIronRub  
y\ILoveIronRuby\IronRubyConsoleApp\Program.cs:line 25  
Press any key to continue . . .

Ivan Porto C. wrote:

> you might want to move the executefile method
> 
> var url = “[http://www.google.com.com](http://www.google.com.com)”;
> 
> ```
> var engine = IronRuby.Ruby.CreateEngine();
> 
> var paths = new List<String>();
> paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib");
> 
> ```
> 
> paths.Add(@“C:\DevTools\ironruby-1.0-rc1\lib\ruby\site\_ruby\1.8”);  
> paths.Add(@“C:\DevTools\ironruby-1.0-rc1\lib\ruby\site\_ruby”);  
> paths.Add(@“C:\DevTools\ironruby-1.0-rc1\lib\ruby\1.8”);
> 
> ```
> engine.SetSearchPaths(paths);
> 
> var obj =
> 
> ```
> 
> engine.Runtime.Globals.GetVariable(“ScreenScraper”);  
> engine.ExecuteFile(“../../screenscraper.rb”);  
> var screenScraper = engine.Operations.CreateInstance(obj);
> 
> ```
> var html = engine.Operations.InvokeMember(screenScraper,
> 
> ```
> 
> “scrape”, url);
> 
> ```
> Console.WriteLine(html);
> 
> ```
> 
> * * *
> 
> Met vriendelijke groeten - Best regards - Salutations  
> Ivan Porto C. - Mob: +32.486.787.582  
> Web: [http://whiterabbitconsulting.eu](http://whiterabbitconsulting.eu) - [http://flanders.co.nz](http://flanders.co.nz)  
> Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
> Author of IronRuby in Action ([IronRuby in Action - Ivan Porto Carrero and Adam Burmister | Manning](http://manning.com/carrero))  
> Microsoft IronRuby/C# MVP

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 4:51pm UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/7 "2010-03-01T16:51:20Z")

</div>

here’s an idea maybe buy my book. All this is explained in there

replace: paths.Add(@“C:\DevTools\ironruby-1.0-rc1\lib”);  
with: paths.Add(@“C:\DevTools\ironruby-1.0-rc1\lib\ironruby”);

That’s the location that contains stringio.rb.

It was like this when I sent the email earlier:

* * *

Met vriendelijke groeten - Best regards - Salutations  
Ivan Porto C.  
Web: [http://whiterabbitconsulting.eu](http://whiterabbitconsulting.eu) - [http://flanders.co.nz](http://flanders.co.nz)  
Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
Author of IronRuby in Action ([http://manning.com/carrero](http://manning.com/carrero))  
Microsoft IronRuby/C# MVP

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 4:52pm UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/8 "2010-03-01T16:52:11Z")

</div>

I copied the ironruby config file into my application’s config file and  
removed all the path variables from my application but it did not work.  
Then I added the “C:\devtools\ironruby-1.0-rc1\lib\ironruby” path and  
removed the app.config and then it worked out.

Any ideas that why even copy pasting the app.config from ironruby to my  
application app.config did not work?

Jim D. wrote:

> You need to include the rest of the ironruby search paths. For example.  
> “C:\devtools\ironruby-1.0-rc1\lib\ironruby”
> 
> Also, the ir.exe.config from c:\devtools\ironruby-1.0-rc1\bin should be  
> setup exactly like you want. If you provide that to your app it should  
> just work. That’s why we install that config file.
> 
> JD

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 4:53pm UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/9 "2010-03-01T16:53:51Z")

</div>

I will definitely buy your book when IronRuby is publicly released! I  
don’t want to consult the book and find out that opps that has now  
changed in the final release.

Ivan Porto C. wrote:

> here’s an idea maybe buy my book. All this is explained in there
> 
> replace: paths.Add(@“C:\DevTools\ironruby-1.0-rc1\lib”);  
> with: paths.Add(@“C:\DevTools\ironruby-1.0-rc1\lib\ironruby”);
> 
> That’s the location that contains stringio.rb.
> 
> It was like this when I sent the email earlier:
> 
> * * *
> 
> Met vriendelijke groeten - Best regards - Salutations  
> Ivan Porto C.  
> Web: [http://whiterabbitconsulting.eu](http://whiterabbitconsulting.eu) - [http://flanders.co.nz](http://flanders.co.nz)  
> Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
> Author of IronRuby in Action ([IronRuby in Action - Ivan Porto Carrero and Adam Burmister | Manning](http://manning.com/carrero))  
> Microsoft IronRuby/C# MVP

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 5:08pm UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/10 "2010-03-01T17:08:53Z")

</div>

a)IronRuby is in the home stretch.  
b)Ivan’s book is keeping up with the development, and if you buy the  
Manning EAP beta, you will get the updates and have the option to get  
the final copy.  
JD

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 4:46pm UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/11 "2010-03-01T16:46:03Z")

</div>

You need to include the rest of the ironruby search paths. For example.  
“C:\devtools\ironruby-1.0-rc1\lib\ironruby”

Also, the ir.exe.config from c:\devtools\ironruby-1.0-rc1\bin should be  
setup exactly like you want. If you provide that to your app it should  
just work. That’s why we install that config file.

JD

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 5:28pm UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/12 "2010-03-01T17:28:47Z")

</div>

Probably because your app config is in a different location than ir.exe.

Try this. Replace:

static void Main(string[] args)  
{  
var url = “[http://www.google.com](http://www.google.com)”;

```
        var engine = IronRuby.Ruby.CreateEngine();

        var paths = new List<String>();
        paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib");
        paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib\ruby\site_ruby\1.8");
        paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib\ruby\site_ruby");
        paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib\ruby\1.8");

        engine.SetSearchPaths(paths);

        engine.ExecuteFile("../../screenscraper.rb");
        var obj =

```

engine.Runtime.Globals.GetVariable(“ScreenScraper”);

```
        var screenScraper = engine.Operations.CreateInstance(obj);

        var html = engine.Operations.InvokeMember(screenScraper,

```

“scrape”, url);

```
        Console.WriteLine(html);

    }

```

With:

static void Main(string[] args)  
{  
var url = “[http://www.google.com](http://www.google.com)”;  
var setup = ScriptRuntimeSetup.ReadConfiguration();  
var scriptRuntime = Ruby.CreateRuntime(setup);  
var engine = Ruby.GetEngine(Runtime);  
//the following line might not be needed in this case  
var context = Ruby.GetExecutionContext(Engine);

```
        engine.ExecuteFile("../../screenscraper.rb");
        var obj =

```

engine.Runtime.Globals.GetVariable(“ScreenScraper”);

```
        var screenScraper = engine.Operations.CreateInstance(obj);

        var html = engine.Operations.InvokeMember(screenScraper,

```

“scrape”, url);

```
        Console.WriteLine(html);

    }

```

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 5:54pm UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/13 "2010-03-01T17:54:33Z")

</div>

Is app.config in the same directory as c:\path\to\ir.exe? I’m guessing  
no. I’m NOT saying it should be. I’m saying use the other hosting method  
I told you to. I believe that will use IronRuby’s exe.config for  
IronRuby. If you don’t want to use my suggestion, then you need to  
modify the relative paths in your app.config to point to the right  
location.

JD

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 5:38pm UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/14 "2010-03-01T17:38:03Z")

</div>

Hi,

> > Probably because your app config is in a different location than ir.exe.

Do you mean the ironruby app config or my application app config? My  
application config is in my application directory. The question is that  
why it is not reading my application config automatically.

Thanks,  
Azam

Jim D. wrote:

> Probably because your app config is in a different location than ir.exe.
> 
> Try this. Replace:
> 
> static void Main(string args)  
> {  
> var url = “[http://www.google.com](http://www.google.com)”;
> 
> ```
> var engine = IronRuby.Ruby.CreateEngine();
> 
> var paths = new List<String>();
> paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib");
> paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib\ruby\site_ruby\1.8");
> paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib\ruby\site_ruby");
> paths.Add(@"C:\DevTools\ironruby-1.0-rc1\lib\ruby\1.8");
> 
> engine.SetSearchPaths(paths);
> 
> engine.ExecuteFile("../../screenscraper.rb");
> var obj =
> 
> ```
> 
> engine.Runtime.Globals.GetVariable(“ScreenScraper”);
> 
> ```
> var screenScraper = engine.Operations.CreateInstance(obj);
> 
> var html = engine.Operations.InvokeMember(screenScraper,
> 
> ```
> 
> “scrape”, url);
> 
> ```
> Console.WriteLine(html);
> 
> }
> 
> ```
> 
> With:
> 
> static void Main(string args)  
> {  
> var url = “[http://www.google.com](http://www.google.com)”;  
> var setup = ScriptRuntimeSetup.ReadConfiguration();  
> var scriptRuntime = Ruby.CreateRuntime(setup);  
> var engine = Ruby.GetEngine(Runtime);  
> //the following line might not be needed in this case  
> var context = Ruby.GetExecutionContext(Engine);
> 
> ```
> engine.ExecuteFile("../../screenscraper.rb");
> var obj =
> 
> ```
> 
> engine.Runtime.Globals.GetVariable(“ScreenScraper”);
> 
> ```
> var screenScraper = engine.Operations.CreateInstance(obj);
> 
> var html = engine.Operations.InvokeMember(screenScraper,
> 
> ```
> 
> “scrape”, url);
> 
> ```
> Console.WriteLine(html);
> 
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 8:01pm UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/15 "2010-03-01T20:01:56Z")

</div>

I used the above code that you provided but it is throwing exceptions:

static void Main(string args)  
{  
var setup = ScriptRuntimeSetup.ReadConfiguration();

```
        var runtime = Ruby.CreateRuntime(setup); // error is thrown 

```

here  
var engine = Ruby.GetEngine(runtime);

And the exception is:

Unhandled Exception: System.ArgumentException: Invalid argument value  
Parameter name: ScriptRuntimeSetup must have at least one LanguageSetup  
at Microsoft.Scripting.Hosting.ScriptRuntimeSetup.ToConfiguration()  
at Microsoft.Scripting.Hosting.ScriptRuntime..ctor(ScriptRuntimeSetup  
setup)  
at IronRuby.Ruby.CreateRuntime(ScriptRuntimeSetup setup)  
at IronRubyConsoleApp.Program.Main(String args) in  
C:\Projects\ILoveIronRub  
y\ILoveIronRuby\IronRubyConsoleApp\Program.cs:line 16  
Press any key to continue . . .

Jim D. wrote:

> Is app.config in the same directory as c:\path\to\ir.exe? I’m guessing  
> no. I’m NOT saying it should be. I’m saying use the other hosting method  
> I told you to. I believe that will use IronRuby’s exe.config for  
> IronRuby. If you don’t want to use my suggestion, then you need to  
> modify the relative paths in your app.config to point to the right  
> location.
> 
> JD

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 8:26pm UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/16 "2010-03-01T20:26:46Z")

</div>

Did you change the paths in the app.config file to be absolute?

* * *

Met vriendelijke groeten - Best regards - Salutations  
Ivan Porto C.  
Web: [http://whiterabbitconsulting.eu](http://whiterabbitconsulting.eu) - [http://flanders.co.nz](http://flanders.co.nz)  
Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
Author of IronRuby in Action ([http://manning.com/carrero](http://manning.com/carrero))  
Microsoft IronRuby/C# MVP

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 8:28pm UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/17 "2010-03-01T20:28:35Z")

</div>

Ahh I did not do that!! I think I will just use path collection and  
List this is just too much work.

Ivan Porto C. wrote:

> Did you change the paths in the app.config file to be absolute?
> 
> * * *
> 
> Met vriendelijke groeten - Best regards - Salutations  
> Ivan Porto C.  
> Web: [http://whiterabbitconsulting.eu](http://whiterabbitconsulting.eu) - [http://flanders.co.nz](http://flanders.co.nz)  
> Twitter: [http://twitter.com/casualjim](http://twitter.com/casualjim)  
> Author of IronRuby in Action ([IronRuby in Action - Ivan Porto Carrero and Adam Burmister | Manning](http://manning.com/carrero))  
> Microsoft IronRuby/C# MVP

---

<div class="post-metadata">

**Author:** ![metanoize](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@metanoize](https://www.ruby-forum.com/u/metanoize)\
**Post date:** [March 1, 2010, 8:04pm UTC](https://www.ruby-forum.com/t/open-uri-path-in-app-config/184327/18 "2010-03-01T20:04:14Z")

</div>

My fault I did not include the App.config settings. So, now I have  
copied everything from ir.exe.config into my App.config and I run the  
application and get the following error:

Unhandled Exception: IronRuby.Builtins.LoadError: no such file to load  
– open-u  
ri  
at  
Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame  
fram  
e)  
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.Hosting.ScriptSource.Execute(ScriptScope  
scope)  
at Microsoft.Scripting.Hosting.ScriptEngine.ExecuteFile(String path)  
at IronRubyConsoleApp.Program.Main(String args) in  
C:\Projects\ILoveIronRub  
y\ILoveIronRuby\IronRubyConsoleApp\Program.cs:line 30  
Press any key to continue . . .

Mohammad A. wrote:

> I used the above code that you provided but it is throwing exceptions:
> 
> static void Main(string args)  
> {  
> var setup = ScriptRuntimeSetup.ReadConfiguration();
> 
> ```
> var runtime = Ruby.CreateRuntime(setup); // error is thrown 
> 
> ```
> 
> here  
> var engine = Ruby.GetEngine(runtime);
> 
> And the exception is:
> 
> Unhandled Exception: System.ArgumentException: Invalid argument value  
> Parameter name: ScriptRuntimeSetup must have at least one LanguageSetup  
> at Microsoft.Scripting.Hosting.ScriptRuntimeSetup.ToConfiguration()  
> at Microsoft.Scripting.Hosting.ScriptRuntime..ctor(ScriptRuntimeSetup  
> setup)  
> at IronRuby.Ruby.CreateRuntime(ScriptRuntimeSetup setup)  
> at IronRubyConsoleApp.Program.Main(String args) in  
> C:\Projects\ILoveIronRub  
> y\ILoveIronRuby\IronRubyConsoleApp\Program.cs:line 16  
> Press any key to continue . . .
> 
> Jim D. wrote:
> 
> > Is app.config in the same directory as c:\path\to\ir.exe? I’m guessing  
> > no. I’m NOT saying it should be. I’m saying use the other hosting method  
> > I told you to. I believe that will use IronRuby’s exe.config for  
> > IronRuby. If you don’t want to use my suggestion, then you need to  
> > modify the relative paths in your app.config to point to the right  
> > location.
> > 
> > JD
