I see. The problem is that an application that is written in a scripting language is not treated the same as a compiled .exe file in CLR's assembly loading mechanism. Executable file defines a directory from whose subdirectories could private assemblies be loaded. Since we have no .exe file for Ruby apps CLR loader doesn't consider the root of the app during the search for an assembly.
I'll add support for loading from .dlls back. Framework assemblies should still be loaded either using Kernel#require(<long assembly name>).
Tomas
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero
Sent: Tuesday, May 13, 2008 6:50 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] r105 broke assembly loading
That also isn't working for me.
If I use /paths:full path here or -I "full path here" it still doesn't let me require that assembly .
On 14/05/2008, at 1:27 PM, Steve Eichert wrote:
I haven't tried revision 105 to know if it still works but I've been using the /paths command line option to tell IronRuby where my assemblies are.
ir.exe paths/:C:\paths\to\my\dlls my_ruby_script.rb
Cheers,
Steve
On Tue, May 13, 2008 at 9:17 PM, Ivan Porto Carrero <ivan at flanders.co.nz<mailto:ivan at flanders.co.nz>> wrote:
Ok I'm all for features but how do I now require my own homebaked dll because registering them in the GAC isn't the way to go IMHO :)
I've tried a bunch of things to get to my dll but it boils down to that it doesn't know how to load it. When I copy my assembly into the ironruby build folder it does work. That just doesn't seem right to me. If there is a new an elegant way to load arbitrary assemblies then I'd love to know. In meantime I can hack my source to add assembly loading from a path as well
Below the output from my various tries to get my assembly loaded without putting it in the ironruby binaries folder
+ C:\projects\lumpr\src\Sylvester.DesktopEdition\Sylvester.IronRuby
> ir -I C:\projects\lumpr\src\Sylvester.DesktopEdition\Sylvester.IronRuby\bin\Sylvester.Contracts.dll
>>> include Twitter::Model
c:\tools\IronRuby\src\IronRuby.Libraries\Builtins\ModuleOps.cs:642:in `ConstantMissing': uninitialized constant Object::
Twitter (NameError)
from :0:in `Initialize##1'
>>> exit
+ C:\projects\lumpr\src\Sylvester.DesktopEdition\Sylvester.IronRuby
> ir -I C:\projects\lumpr\src\Sylvester.DesktopEdition\Sylvester.IronRuby\bin
>>> require 'Sylvester.Contracts, Version=1.0.0.0<http://1.0.0.0>, Culture=neutral, PublicKeyToken=null'
c:\tools\IronRuby\src\IronRuby.Libraries\Builtins\Kernel.cs:272:in `Require': no such file to load -- Sylvester.Contract
s, Version=1.0.0.0<http://1.0.0.0>, Culture=neutral, PublicKeyToken=null (LoadError)
from :0:in `Initialize##1'
>>> exit
+ C:\projects\lumpr\src\Sylvester.DesktopEdition\Sylvester.IronRuby
> ir
>>> Dir.chdir('C:\projects\lumpr\src\Sylvester.DesktopEdition\Sylvester.IronRuby\bin')
=> 0
>>> require 'Sylvester.Contracts, Version=1.0.0.0<http://1.0.0.0>, Culture=neutral, PublicKeyToken=null'
c:\tools\IronRuby\src\IronRuby.Libraries\Builtins\Kernel.cs:272:in `Require': no such file to load -- Sylvester.Contract
s, Version=1.0.0.0<http://1.0.0.0>, Culture=neutral, PublicKeyToken=null (LoadError)
from :0:in `Initialize##7'
>>> exit
+ C:\projects\lumpr\src\Sylvester.DesktopEdition\Sylvester.IronRuby
> ir -I C:\projects\lumpr\src\Sylvester.DesktopEdition\Sylvester.IronRuby\bin
>>> Dir.chdir('C:\projects\lumpr\src\Sylvester.DesktopEdition\Sylvester.IronRuby\bin')
=> 0
>>> require 'Sylvester.Contracts, Version=1.0.0.0<http://1.0.0.0>, Culture=neutral, PublicKeyToken=null'
c:\tools\IronRuby\src\IronRuby.Libraries\Builtins\Kernel.cs:272:in `Require': no such file to load -- Sylvester.Contract
s, Version=1.0.0.0<http://1.0.0.0>, Culture=neutral, PublicKeyToken=null (LoadError)
from :0:in `Initialize##8'
>>>
Thanks
Ivan
On 14/05/2008, at 10:42 AM, John Lam (IRONRUBY) wrote:
One more thing, r105 adds support for the -I command line switch, so you can now:
ir -I path-to-your-includes-directory yourapp.rb
Thanks,
-John
-----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 Ivan Porto Carrero
Sent: Tuesday, May 13, 2008 3:32 PM
To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org>
Subject: [Ironruby-core] r105 broke assembly loading
Hi
I just updated to r105 and now I can't require assemblies anymore.
require 'bin/System.Net.dll'
c:\tools\IronRuby\src\IronRuby.Libraries\Builtins\Kernel.cs:272:in
`Require': Invalid character '?' in expression (Synta
xError)
from :0:in `Initialize##1'
Do I submit a bug for that?
Cheers
Ivan
_______________________________________________
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/20080513/c814dc46/attachment-0001.html>