Hi,
I am using the following code to do some screen scraping but it says "no
such file to load open-uri".
Here is the code:
  require ''open-uri''
            require ''uri''
            class Person
            def greet()
            puts ''hello world''
            end
Thanks,
Azam
-- 
Posted via http://www.ruby-forum.com/.
2009/6/10 Mohammad Azam <lists at ruby-forum.com>:> I am using the following code to do some screen scraping but it says "no > such file to load open-uri".require ''open-uri'' works for me. Which version of IronRuby are you using? -- Seo Sanghyeon
Thanks for the reply!
Actually I am trying to run the open method using C#. Here is the code:
 dynamic rubyPerson =  (engine.Execute(@"
            require ''open-uri''
            class Person
            def greet()
            puts ''hello world''
            end
            end
            def getPerson()
            f = open(''http://www.azamsharp.com/Default.aspx'')
            end
            getPerson()
            "));
And here is the error:
no such file to load open-uri
-- 
Posted via http://www.ruby-forum.com/.
You may need to call ScriptEngine.SearchPaths to initialize the path.
-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Mohammad Azam
Sent: Tuesday, June 09, 2009 6:54 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] How to use open-uri
Thanks for the reply!
Actually I am trying to run the open method using C#. Here is the code:
 dynamic rubyPerson =  (engine.Execute(@"
            require ''open-uri''
            class Person
            def greet()
            puts ''hello world''
            end
            end
            def getPerson()
            f = open(''http://www.azamsharp.com/Default.aspx'')
            end
            getPerson()
            "));
And here is the error:
no such file to load open-uri
-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ironruby-core mailing list
Ironruby-core at rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core
I am using the following now:
 var paths = new List<String>();
           
paths.Add(@"C:\ironruby\ironruby\Merlin\Main\Languages\Ruby\Libs");
            scriptEngine.SetSearchPaths(paths);
But still the same error!
-- 
Posted via http://www.ruby-forum.com/.
Thanks I got it working using the following path:
 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");
-- 
Posted via http://www.ruby-forum.com/.