open-uri gives errors for MacOS Snow Leopard

Discussion in 'Ruby' started by Soichi Ishida, Nov 11, 2010.

  1. My environment:
    Mac OS 10.6.4
    Ruby 1.8
    RubyGems 1.3.7
    nokogiri -v:

    ruby:
    engine: mri
    version: 1.8.7
    platform: universal-darwin10.0
    libxml:
    loaded: 2.7.3
    binding: extension
    compiled: 2.7.3
    nokogiri: 1.4.3.1

    ------the question follows

    hi. executing a ruby program using nokogiri and open-uri gives errors
    like,

    ------the error is -------
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:32:in
    `initialize': No such file or directory - (Errno::ENOENT)
    from
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:32:in
    `open_uri_original_open'
    from
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:32:in
    `open'
    from thesis_get.rb:26
    from
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:32:in
    `open_uri_original_open'
    from
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:32:in
    `open'
    from thesis_get.rb:23
    ----------------------

    the ruby program did work for Ubuntu 8.04 but not for MacOS Snow
    Leopard.

    Do I need to install something else for MacOS to make the program work?

    --
    Posted via http://www.ruby-forum.com/.
    Soichi Ishida, Nov 11, 2010
    #1
    1. Advertising

  2. On Thu, Nov 11, 2010 at 9:08 AM, Soichi Ishida
    <> wrote:
    > My environment:
    > Mac OS 10.6.4
    > Ruby 1.8
    > RubyGems 1.3.7
    > nokogiri -v:
    >
    > ruby:
    > =A0engine: mri
    > =A0version: 1.8.7
    > =A0platform: universal-darwin10.0
    > libxml:
    > =A0loaded: 2.7.3
    > =A0binding: extension
    > =A0compiled: 2.7.3
    > nokogiri: 1.4.3.1
    >
    > ------the question follows
    >
    > hi. executing a ruby program using nokogiri and open-uri gives errors
    > like,
    >
    > ------the error is -------
    > /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/o=

    pen-uri.rb:32:in
    > `initialize': No such file or directory - =A0(Errno::ENOENT)


    The error message above looks like it tries to open the empty file name:

    16:24:03 $ ruby19 -e 'File.open("")'
    -e:1:in `initialize': No such file or directory - (Errno::ENOENT)
    from -e:1:in `open'
    from -e:1:in `<main>'

    This means either you passed the empty string in or the code somehow
    converted what you passed to this. We would need to see more though
    in order to decide what's going on.

    Kind regards

    robert

    --=20
    remember.guy do |as, often| as.you_can - without end
    http://blog.rubybestpractices.com/
    Robert Klemme, Nov 11, 2010
    #2
    1. Advertising

  3. Thanks for your reply robert.

    As you pointed out, there was a blank line that the ruby program reads.
    That was the problem.

    Sorry about my carelessness.

    Thanks again.

    Soichi

    --
    Posted via http://www.ruby-forum.com/.
    Soichi Ishida, Nov 12, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alia Khouri

    python version in snow leopard?

    Alia Khouri, Jun 9, 2009, in forum: Python
    Replies:
    2
    Views:
    261
    Alia K
    Jun 9, 2009
  2. Roedy Green

    Java hom foer the Mac Snow Leopard?

    Roedy Green, Sep 2, 2009, in forum: Java
    Replies:
    7
    Views:
    374
    Kevin McMurtrie
    Sep 7, 2009
  3. Xiao Yu
    Replies:
    0
    Views:
    405
    Xiao Yu
    Oct 13, 2009
  4. Zectbumo
    Replies:
    1
    Views:
    363
  5. TomTom III
    Replies:
    5
    Views:
    98
    Marnen Laibow-Koser
    Feb 2, 2010
Loading...

Share This Page