I playing with using ERB in IronRuby and having a little problem. The code below works fine with Ruby: require ''erb'' puts ERB.new(''hello world'').result but in IronRuby I get this error: IronRuby.Libraries:0:in `require'': no such file to load -- erb (LoadError) from :0 Now if I change the require to this it works: require ''C:\ruby\lib\ruby\1.8\erb.rb'' puts ERB.new(''hello world'').result I assume my IronRuby config is wrong but how do I fix it? -- Posted via http://www.ruby-forum.com/.
There should be a line in ir.exe.config that says something like: <set language="Ruby" option="LibraryPaths" value="..\..\Languages\Ruby\libs\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\1.8\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\1.8\" /> These paths need to point to your MRI installation. Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Paul Wheeler Sent: Thursday, January 29, 2009 2:01 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] ERB I playing with using ERB in IronRuby and having a little problem. The code below works fine with Ruby: require ''erb'' puts ERB.new(''hello world'').result but in IronRuby I get this error: IronRuby.Libraries:0:in `require'': no such file to load -- erb (LoadError) from :0 Now if I change the require to this it works: require ''C:\ruby\lib\ruby\1.8\erb.rb'' puts ERB.new(''hello world'').result I assume my IronRuby config is wrong but how do I fix it? -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
Hello,> There should be a line in ir.exe.config that says something like: > > <set language="Ruby" option="LibraryPaths" value="..\..\Languages\Ruby\libs\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\1.8\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\1.8\" /> > > These paths need to point to your MRI installation.just curious (ie. I don''t need this yet): is there currently a way to set this programmatically, maybe while instantiating the IronRuby host ? -- Thibaut
Yes. Something like this should do: var engine = IronRuby.Ruby.CreateEngine((setup) => { setup.Options["LibraryPaths"] = "..." }); engine.Execute(code); Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Thibaut Barr?re Sent: Friday, January 30, 2009 12:12 AM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] ERB Hello,> There should be a line in ir.exe.config that says something like: > > <set language="Ruby" option="LibraryPaths" value="..\..\Languages\Ruby\libs\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\1.8\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\1.8\" /> > > These paths need to point to your MRI installation.just curious (ie. I don''t need this yet): is there currently a way to set this programmatically, maybe while instantiating the IronRuby host ? -- Thibaut _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
> var engine = IronRuby.Ruby.CreateEngine((setup) => { setup.Options["LibraryPaths"] = "..." });easy - great! Thanks, Thibaut
Tomas Matousek wrote:> There should be a line in ir.exe.config that says something like: > > <set language="Ruby" option="LibraryPaths" > value="..\..\Languages\Ruby\libs\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\1.8\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\1.8\" > /> > > These paths need to point to your MRI installation. > > TomasThat worked great! All I had to do is copy the App.Config in the \Codeplex-DLR-0.9\ folder over to ir.exe.config and add my path. Thanks! -- Posted via http://www.ruby-forum.com/.