oneclick / rubyinstaller2

MSYS2 based RubyInstaller for Windows
https://rubyinstaller.org
BSD 3-Clause "New" or "Revised" License
645 stars 248 forks source link

irb.cmd not found while opening Interactive Ruby #290

Closed tahirasma closed 1 year ago

tahirasma commented 2 years ago

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

mohits commented 2 years ago

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 commented 1 year ago

Hi @tahirasma - did you manage to progress?

tahirasma commented 1 year ago

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

mohits commented 1 year ago

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

cremno commented 1 year ago

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?

MSP-Greg commented 1 year ago

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?

cremno commented 1 year ago

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

mohits commented 1 year ago

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.

MSP-Greg commented 1 year ago

@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...

ralish commented 1 year ago

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

larskanis commented 1 year ago

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