Project

General

Profile

Actions

Bug #4731

closed

ruby -S irb fails with mingw/msys vanilla builds

Added by rogerdpack (Roger Pack) almost 13 years ago. Updated over 6 years ago.

Status:
Rejected
Target version:
-
ruby -v:
-
Backport:
[ruby-core:36316]

Description

as reported originally with http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/36285
basically mingw builds fail with $ ruby -S irb and always have, at least for the 1.9 branches.

$ ruby -S irb
ruby: No such file or directory -- irb (LoadError)

Updated by ko1 (Koichi Sasada) almost 13 years ago

  • Status changed from Open to Assigned
  • Assignee set to nobu (Nobuyoshi Nakada)

Updated by nobu (Nobuyoshi Nakada) over 12 years ago

  • Status changed from Assigned to Feedback

I can't reproduce it.
Is irb only a batch file, or an exe file?

Updated by luislavena (Luis Lavena) over 12 years ago

Nobuyoshi Nakada wrote:

I can't reproduce it.
Is irb only a batch file, or an exe file?

After make install the end result in the indicated prefix is a series of batch files like: irb.bat which contains a mix of windows commands and the Ruby script in it, which is then fired using ruby -x

On RubyInstaller we replaced that with plain stubs and the original scripts from Ruby's source code, see here:

https://github.com/oneclick/rubyinstaller/blob/master/recipes/interpreter/ruby19.rake#L146-149
https://github.com/oneclick/rubyinstaller/blob/master/recipes/interpreter/ruby19.rake#L156-161
https://github.com/oneclick/rubyinstaller/blob/master/recipes/interpreter/ruby19.rake#L182-191

This workaround was implemented so ruby -S irb works.

Updated by nobu (Nobuyoshi Nakada) over 12 years ago

  • ruby -v changed from ruby 1.9.3dev (2011-05-18 trunk 31614) [i386-mingw32] to -

Hi,

At Fri, 15 Jul 2011 21:28:50 +0900,
Luis Lavena wrote in [ruby-core:38075]:

On RubyInstaller we replaced that with plain stubs and the
original scripts from Ruby's source code, see here:

I see. There is only irb.bat, not irb sans the suffix. In
that sense, it's natural to fail, but maybe unexpected
behavior. Now I'm thinking to make -S option search with .bat
(and .cmd too) suffix if it is not found. How do you feel
about this?


diff --git a/ruby.c b/ruby.c
index 93b12d8..b8258ea 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1288,14 +1288,42 @@ process_options(int argc, char **argv, struct
cmdline_options *opt)
}
else if (opt->do_search) {
char *path

Updated by luislavena (Luis Lavena) over 12 years ago

On Sat, Jul 16, 2011 at 7:46 AM, Nobuyoshi Nakada wrote:

I see.  There is only irb.bat, not irb sans the suffix.  In
that sense, it's natural to fail, but maybe unexpected
behavior.  Now I'm thinking to make -S option search with .bat
(and .cmd too) suffix if it is not found.  How do you feel
about this?

Thank you Nakada-san, I see a few drawbacks with this approach:

  • For a missing script (e.g. foo), system will attempt to find two
    extra "foo.bat" and "foo.cmd" in all portions of PATH, which will be
    expensive.

  • It will introduce a platform-specific discrepancy that other
    implementations will either need to implement or indicate that are not
    compatible.

I would like to understand why original script is merged with the
batchfile stub in tools/rbinstall.rb

Perhaps we can remove that?

The only reason I see with this is PowerShell, which finds the
extensionless script prior the .bat one and attempts to execute it
(dunno why, but that is what it tries).

For users with PowerShell I've always recommend them use "ruby -S
script" instead.

Thank you for your time.

Luis Lavena
AREA 17

Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

Updated by nobu (Nobuyoshi Nakada) over 12 years ago

Hi,

At Sun, 17 Jul 2011 05:22:32 +0900,
Luis Lavena wrote in [ruby-core:38108]:

I would like to understand why original script is merged with the
batchfile stub in tools/rbinstall.rb

Perhaps we can remove that?

Removing the stub, or splitting to a batch file and a script
file?

The only reason I see with this is PowerShell, which finds the
extensionless script prior the .bat one and attempts to execute it
(dunno why, but that is what it tries).

The reason is just that one file is handier than two files.
I know nothing about PowerShell.

--
Nobu Nakada

Updated by luislavena (Luis Lavena) over 12 years ago

On Thu, Jul 21, 2011 at 11:07 AM, Nobuyoshi Nakada wrote:

Hi,

At Sun, 17 Jul 2011 05:22:32 +0900,
Luis Lavena wrote in [ruby-core:38108]:

I would like to understand why original script is merged with the
batchfile stub in tools/rbinstall.rb

Perhaps we can remove that?

Removing the stub, or splitting to a batch file and a script
file?

Splitting to back and script file.

The only reason I see with this is PowerShell, which finds the
extensionless script prior the .bat one and attempts to execute it
(dunno why, but that is what it tries).

The reason is just that one file is handier than two files.

What particular thing are you doing with the files? If I move I move
the entire directory.

Thank you.

Luis Lavena
AREA 17

Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

Updated by drbrain (Eric Hodel) about 11 years ago

Luis, Nobu, what is the status of this?

Updated by luislavena (Luis Lavena) about 11 years ago

  • Status changed from Feedback to Assigned
  • Assignee changed from nobu (Nobuyoshi Nakada) to luislavena (Luis Lavena)

drbrain (Eric Hodel) wrote:

Luis, Nobu, what is the status of this?

I proposed an alternate rbinstall.rb method in #6769 that will correct this issue.

However, workload has been high and code in rbinstall.rb is not very clear.

Updated by luislavena (Luis Lavena) over 8 years ago

  • Assignee changed from luislavena (Luis Lavena) to nobu (Nobuyoshi Nakada)

Updated by hsbt (Hiroshi SHIBATA) over 6 years ago

  • Status changed from Assigned to Rejected

I couldn't reproduce this with RubyInstaller 2.4.1-2.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0