In `read': No such file or directory @ rb_sysopen - -d (Errno::ENOENT)

Hi all,

I am using ruby 2.1.2p95, below on line no. 1,

File.read(module_file).split("\n").each do |i|

      import = i.slice(/FROM [\w-]+/)

      if import != nil

        imports += "-p #{import.gsub('FROM ','')}.mib "

      end

    end

I am getting this error:

:in `read': No such file or directory @ rb_sysopen - -d (Errno::ENOENT)

Please help me out.

Best regards,

Stefan

File.read(module_file).split("\n").each do |i|

...

I am getting this error:

:in `read': No such file or directory @ rb_sysopen - -d (Errno::ENOENT)

Please help me out.

Look somehow at the value of module_file at that point. Verify that
there is something there, that Ruby can read. If it's a relative path
(vs. absolute), remember to compensate for where the program may be
running.

-Dave

···

On Wed, May 25, 2016 at 10:14 AM, stefansaye <stefan.saye@gmail.com> wrote:

--
Dave Aronson, consulting software developer of Codosaur.us,
PullRequestRoulette.com, Blog.Codosaur.us, and Dare2XL.com.

The ruby code and module_file are all in the same dir
And I'm run the code in the dir too

Aronson

···

-----Original Message-----
From: ruby-talk [mailto:ruby-talk-bounces@ruby-lang.org] On Behalf Of Dave
Sent: Wednesday, May 25, 2016 10:22 PM
To: Ruby users <ruby-talk@ruby-lang.org>
Subject: Re: in `read': No such file or directory @ rb_sysopen - -d
(Errno::ENOENT)

On Wed, May 25, 2016 at 10:14 AM, stefansaye <stefan.saye@gmail.com> wrote:

File.read(module_file).split("\n").each do |i|

...

I am getting this error:

:in `read': No such file or directory @ rb_sysopen - -d
(Errno::ENOENT)

Please help me out.

Look somehow at the value of module_file at that point. Verify that there
is something there, that Ruby can read. If it's a relative path (vs.
absolute), remember to compensate for where the program may be running.

-Dave

--
Dave Aronson, consulting software developer of Codosaur.us,
PullRequestRoulette.com, Blog.Codosaur.us, and Dare2XL.com.

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Debug:
1. Use puts or pp
2. Byebug
3. Pry

···

On Wednesday, 25 May 2016, stefansaye <stefan.saye@gmail.com> wrote:

The ruby code and module_file are all in the same dir
And I'm run the code in the dir too

-----Original Message-----
From: ruby-talk [mailto:ruby-talk-bounces@ruby-lang.org <javascript:;>]
On Behalf Of Dave
Aronson
Sent: Wednesday, May 25, 2016 10:22 PM
To: Ruby users <ruby-talk@ruby-lang.org <javascript:;>>
Subject: Re: in `read': No such file or directory @ rb_sysopen - -d
(Errno::ENOENT)

On Wed, May 25, 2016 at 10:14 AM, stefansaye <stefan.saye@gmail.com > <javascript:;>> wrote:

> File.read(module_file).split("\n").each do |i|
...

> I am getting this error:
>
> :in `read': No such file or directory @ rb_sysopen - -d
> (Errno::ENOENT)
>
> Please help me out.

Look somehow at the value of module_file at that point. Verify that there
is something there, that Ruby can read. If it's a relative path (vs.
absolute), remember to compensate for where the program may be running.

-Dave

--
Dave Aronson, consulting software developer of Codosaur.us,
PullRequestRoulette.com, Blog.Codosaur.us, and Dare2XL.com.

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org <javascript:;>
?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org <javascript:;>
?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

What is the value of module_file? Can you print that out? From the error
seems like it has the wrong name. May be you are setting the value to an
incorrect argument?

···

On Wed, May 25, 2016, 7:40 AM Daniel Ferreira < danieldasilvaferreira@gmail.com> wrote:

Debug:
1. Use puts or pp
2. Byebug
3. Pry

On Wednesday, 25 May 2016, stefansaye <stefan.saye@gmail.com> wrote:

The ruby code and module_file are all in the same dir
And I'm run the code in the dir too

-----Original Message-----
From: ruby-talk [mailto:ruby-talk-bounces@ruby-lang.org] On Behalf Of
Dave
Aronson
Sent: Wednesday, May 25, 2016 10:22 PM
To: Ruby users <ruby-talk@ruby-lang.org>
Subject: Re: in `read': No such file or directory @ rb_sysopen - -d
(Errno::ENOENT)

On Wed, May 25, 2016 at 10:14 AM, stefansaye <stefan.saye@gmail.com> >> wrote:

> File.read(module_file).split("\n").each do |i|
...

> I am getting this error:
>
> :in `read': No such file or directory @ rb_sysopen - -d
> (Errno::ENOENT)
>
> Please help me out.

Look somehow at the value of module_file at that point. Verify that there
is something there, that Ruby can read. If it's a relative path (vs.
absolute), remember to compensate for where the program may be running.

-Dave

--
Dave Aronson, consulting software developer of Codosaur.us,
PullRequestRoulette.com, Blog.Codosaur.us, and Dare2XL.com.

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--

- Raj

Try the actual file name with extension in quotes unless it was declared
above somewhere.

···

On Wed, May 25, 2016 at 9:19 AM Raj Sahae <rajsahae@gmail.com> wrote:

What is the value of module_file? Can you print that out? From the error
seems like it has the wrong name. May be you are setting the value to an
incorrect argument?

On Wed, May 25, 2016, 7:40 AM Daniel Ferreira < > danieldasilvaferreira@gmail.com> wrote:

Debug:
1. Use puts or pp
2. Byebug
3. Pry

On Wednesday, 25 May 2016, stefansaye <stefan.saye@gmail.com> wrote:

The ruby code and module_file are all in the same dir
And I'm run the code in the dir too

-----Original Message-----
From: ruby-talk [mailto:ruby-talk-bounces@ruby-lang.org] On Behalf Of
Dave
Aronson
Sent: Wednesday, May 25, 2016 10:22 PM
To: Ruby users <ruby-talk@ruby-lang.org>
Subject: Re: in `read': No such file or directory @ rb_sysopen - -d
(Errno::ENOENT)

On Wed, May 25, 2016 at 10:14 AM, stefansaye <stefan.saye@gmail.com> >>> wrote:

> File.read(module_file).split("\n").each do |i|
...

> I am getting this error:
>
> :in `read': No such file or directory @ rb_sysopen - -d
> (Errno::ENOENT)
>
> Please help me out.

Look somehow at the value of module_file at that point. Verify that
there
is something there, that Ruby can read. If it's a relative path (vs.
absolute), remember to compensate for where the program may be running.

-Dave

--
Dave Aronson, consulting software developer of Codosaur.us,
PullRequestRoulette.com, Blog.Codosaur.us, and Dare2XL.com.

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--

- Raj

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;