rubyinstaller2 icon indicating copy to clipboard operation
rubyinstaller2 copied to clipboard

irb.cmd not found while opening Interactive Ruby

Open tahirasma opened this issue 3 years ago • 9 comments

Hi,

I am encountering issue while opening the Interactive Ruby. While the command prompt appears to install Ruby Installer, (during the second step) press Enter, the window disappears.

When opening the Interactive Ruby, it gives the error,"irb.cmd not found. Please browse".

Looking forward for your assistance.

OS: Windows 10 64-bit

tahirasma avatar Jun 29 '22 10:06 tahirasma

Hi @tahirasma - this sounds like a case that Ruby is not on your path. The installation makes adding Ruby to your path optional.

Could you open a command prompt and type path and paste the result here. That will help to check if it is on your path.

Thanks!

mohits avatar Jul 01 '22 10:07 mohits

Hi @tahirasma - did you manage to progress?

mohits avatar Jul 15 '22 01:07 mohits

Yup, I was able to solve this issue. I just re-installed Ruby and it worked...

tahirasma avatar Jul 15 '22 13:07 tahirasma

Great @tahirasma - I will close this issue in that case. Hope you enjoy your Ruby experience!

mohits avatar Jul 18 '22 06:07 mohits

I have the same issue with 3.1.2-1 (x64). Windows is looking for irb.cmd but only irb.bat exists. Other binstubs also have the .bat extension, not *.cmd. Maybe RubyGems has changed something but I can't find anything recent and of interest in their changelog.

@tahirasma Which version are you using? Does it still work if you run gem update --system or gem update irb?

cremno avatar Jul 18 '22 19:07 cremno

Windows is looking for irb.cmd

Interesting. No mention of the file name on my system.

What happens if you type bundler -v? You may not have the Ruby bin folder in your path?

MSP-Greg avatar Jul 18 '22 20:07 MSP-Greg

RubyInstaller set up the shortcut but irb.cmd does not exist (anymore?). Only irb.bat. Running irb (without any extension) via command line works. But I can't really say for sure if I ever used the Interactive Ruby shortcut before.

Bundler version 2.3.18

cremno avatar Jul 19 '22 04:07 cremno

Ok, re-opening this. This is a great find @cremno.

[1] We don't notice this when we do it from the command line since we use irb and that matches irb.bat

[2] This is broken when you run it from the Program Files > Ruby 3.1.1-1-x64-ucrt with MSYS2 > Interactive Ruby since it links to: C:\Ruby31-x64\bin\irb.cmd -rirb/completion (i.e., irb.cmd)

[3] This was correctly created in Ruby 3.0 which also connects to: C:\Ruby30-x64\bin\irb.cmd -rirb/completion but in that case, the cmd files are there:

C:\Ruby30-x64\bin>
$ dir *.cmd
 Volume in drive C is Windows
 Volume Serial Number is B66E-BE64

 Directory of C:\Ruby30-x64\bin

2021-11-27  03:46 PM               672 bundle.cmd
2021-11-27  03:46 PM               674 bundler.cmd
2021-11-27  03:46 PM               650 erb.cmd
2021-11-27  03:46 PM               688 gem.cmd
2021-11-27  03:46 PM               685 irb.cmd
2021-11-27  03:46 PM               729 racc.cmd
2021-11-27  03:46 PM                41 rake.cmd
2021-11-27  03:46 PM               656 rdoc.cmd
2021-11-27  03:46 PM               652 ri.cmd
2021-11-27  03:46 PM               694 ridk.cmd
2021-11-27  03:46 PM               312 setrbvars.cmd

Most of these are missing in Ruby 3.1 and that causes this issue. I think it is a bug.

mohits avatar Jul 19 '22 05:07 mohits

@cremno

Sorry, I saw 'When opening the Interactive Ruby', I didn't know you were using a shortcut. I've only used the installer to test it, I normally install Rubies from the 7z files, so I've never used the shortcuts.

Regardless, as mentioned, 3.0 has cmd files, 3.1 has bat files. Not sure where the change came from...

MSP-Greg avatar Jul 19 '22 15:07 MSP-Greg

I'm seeing the same issue with the shortcut pointing to irb.cmd instead of the correct irb.bat file. Curiously, for me the irb.cmd exists but is empty (0 bytes). I'm certain I didn't create it; it likely got created as a by product of some other process. Except as it exists but is empty, attempting to run the shortcut gives the rather intimidating message: image

ralish avatar Nov 20 '22 00:11 ralish

This is fixed in commit https://github.com/oneclick/rubyinstaller2/commit/8c7d471d6d3aabeb92f9caa0b82217e99d8ca804 . And the other start menu entries should also work again.

larskanis avatar Dec 20 '22 19:12 larskanis