Help: IRB not run

My PC is Windows 10 64-bit professional. I installed IRB 3.0.0-1 x64 without development software. When I clicked interactive ruby, the shell was displayed. In a couple of seconds, it disappeared.

Then I tried to open CMD shell and typed IRB. IRB won’t run and following messages are displayed,

C:\Users\lyang>irb
C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/irbrc_predefiner.rb:6:in write': No such file or directory @ rb_sysopen - P://.irbrc (Errno::ENOENT) from C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0/irbrc_predefiner.rb:6:in <top (required)>’
from internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb:85:in require' from <internal:C:/Ruby30-x64/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in require’
from C:/Ruby30-x64/bin/irb.cmd:31:in `’

I installed the same software on another PC with Windows 10, and IRB runs fine.

Can someone help me to resolve this problem?

Thank you.

Longxiang Yang

What is drive P:? You might want to reinstall Ruby, that might fix it.

Hello Keith,

Thank you for your reply. I checked my PC and found P drive is mapped to a network drive. I deleted the P drive, restarted PC. Make sure the P drive is removed. I reinstalled IRB 3.0.0-1 x64. IRB still doesn’t work as before. Same error message is displayed when I used CMD to run IRB.

/Ruby30-x64/lib/ruby/site_ruby/3.0.0/irbrc_predefiner.rb:6:in `write’: No such file or directory @ rb_sysopen - P://.irbrc (Errno::ENOENT)

I further looked at irbrc_predefiner.rb file. Line 6 shows:

File.write irbrc_file, <<-EOT

I don’t understand why it is pointing to a non-existing P: drive.

Any further help is greatly appreciated.

Longxiang Yang

I’m just guessing here, but do you have an environment variable pointing to P:? Such as HOME?

Hi Keith,

I reviewed my Windows registers and found home drive is set to P. After changing it to C. IRB is running properly.

Thank you very much for your help.

Longxiang Yang

1 Like