IRB not working

290 views
Skip to first unread message

helen judd

unread,
Dec 30, 2020, 4:30:56 PM12/30/20
to RubyInstaller
Hi

I just installed ruby and doing a basics course. It seems that ruby has installed properly but IRB isn't working:

Traceback (most recent call last):
        4: from C:/Ruby27-x64/bin/irb.cmd:31:in `<main>'
        3: from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        2: from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        1: from C:/Ruby27-x64/lib/ruby/site_ruby/2.7.0/irbrc_predefiner.rb:6:in `<top (required)>'
C:/Ruby27-x64/lib/ruby/site_ruby/2.7.0/irbrc_predefiner.rb:6:in `write': No such file or directory @ rb_sysopen - U://.irbrc (Errno::ENOENT)

Anyone know why?
Thanks
Helen

Lars Kanis

unread,
Dec 30, 2020, 5:04:32 PM12/30/20
to 'helen judd' via RubyInstaller

RubyInstaller per default writes a .irbrc file with some settings for a more convenient irb experience. This file is saved in the first matching directory out of these: https://github.com/ruby/ruby/blob/b2030d4dae3142e3fe6ad79ac1202de5a9f34a5a/lib/irb/init.rb#L337-L358

So I think you have a environment variable "IRBRC" or "HOME" pointing to the non existent drive U:. So you should fix the variable so that it points to an existent directory.

--
Regards,
Lars

Am 30.12.20 um 21:09 schrieb 'helen judd' via RubyInstaller:
--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyinstalle...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyinstaller/46f7037a-5501-4578-934f-511882dfcb97n%40googlegroups.com.

Sofie Vigström

unread,
Feb 1, 2021, 5:07:38 AM2/1/21
to RubyInstaller
Hi
I am having the same problem as Helen and my path includes both java and ruby (verified .exe locations from the Explorer). The irb console flashes but closes again.
I'm guessing the H:// folder is some fallback it tries but it does not exist.
I have only added Ruby to the path, the rest is from a sys admin at my company.

///////// -----------------------------

C:\WINDOWS\system32>path
PATH=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Ruby27-x64\bin;C:\Users\sofie.vigstrom\AppData\Local\Microsoft\WindowsApps

--------------- ///////////

C:\WINDOWS\system32>irb
Traceback (most recent call last):
        4: from C:/Ruby27-x64/bin/irb.cmd:31:in `<main>'
        3: from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        2: from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        1: from C:/Ruby27-x64/lib/ruby/site_ruby/2.7.0/irbrc_predefiner.rb:6:in `<top (required)>'
C:/Ruby27-x64/lib/ruby/site_ruby/2.7.0/irbrc_predefiner.rb:6:in `write': No such file or directory @ rb_sysopen - H://.irbrc (Errno::ENOENT)

----------  /////////////

Thank you!

/Sofie

Den onsdag 30 december 2020 kl. 23:04:32 UTC+1 skrev Lars Kanis:

RubyInstaller per default writes a .irbrc file with some settings for a more convenient irb experience. This file is saved in the first matching directory out of these: https://github.com/ruby/ruby/blob/b2030d4dae3142e3fe6ad79ac1202de5a9f34a5a/lib/irb/init.rb#L337-L358

So I think you have a environment variable "IRBRC" or "HOME" pointing to the non existent drive U:. So you should fix the variable so that it points to an existent directory.

--
Regards,
Lars

Am 30.12.20 um 21:09 schrieb 'helen judd' via RubyInstaller:
Hi

I just installed ruby and doing a basics course. It seems that ruby has installed properly but IRB isn't working:

Traceback (most recent call last):
        4: from C:/Ruby27-x64/bin/irb.cmd:31:in `<main>'
        3: from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        2: from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
        1: from C:/Ruby27-x64/lib/ruby/site_ruby/2.7.0/irbrc_predefiner.rb:6:in `<top (required)>'
C:/Ruby27-x64/lib/ruby/site_ruby/2.7.0/irbrc_predefiner.rb:6:in `write': No such file or directory @ rb_sysopen - U://.irbrc (Errno::ENOENT)

Anyone know why?
Thanks
Helen
--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyin...@googlegroups.com.

Roy Pardee

unread,
Feb 1, 2021, 6:44:38 AM2/1/21
to rubyinstaller
Any difference if you first cd into, say, C:\Users\sofie.vigstrom?

So:
- open normal command prompt (win-r; cmd; enter)
- cd c:\users\sofie.vigstrom (if not already there)
- run command irb

My theory is that irb is trying to write its .irbrc & .irb_history files someplace your account doesn't have permissions to write (like c:\windows\system32 or some such).

HTH,

-Roy

To unsubscribe from this group and stop receiving emails from it, send an email to rubyinstalle...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyinstaller/e56169d4-5884-4d72-a807-b8524d1b75aeo%40googlegroups.com.


--

Sofie Vigström

unread,
Feb 1, 2021, 11:29:39 AM2/1/21
to RubyInstaller
Thanks for fast reply!
I tried that, and got the same error message. I did a reinstall today and it actually shows the error during installation.
I am writing to ask if you understand where the tmp folder is that it is referring to? The installation files are directly under C:.
Please se attached error from installation log:

> sh -lc true

mkdir: kan inte skapa katalog ”/h/”: No such file or directory

/h/ could not be created.

Setting HOME to /tmp.


Thanks!!
Sofie 

Roy Pardee

unread,
Feb 1, 2021, 11:55:43 AM2/1/21
to rubyinstaller
Alas, I don't. It looks like the error you posted is in the msys2 portion of the install, which is well out of my depth, unfortunately.

Hopefully Lars or someone else more knowledgeable will chime in.

If you get desperate enough, you might try defining a new windows environment var called HOME, set it to the value %HOMEDRIVE%%HOMEPATH% and then re-try the install & see if you have any better luck.

Good luck!


To unsubscribe from this group and stop receiving emails from it, send an email to rubyinstalle...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyinstaller/d8d84881-2e5a-4b3a-b2b9-ef278388417do%40googlegroups.com.

Sofie Vigström

unread,
Feb 1, 2021, 1:19:08 PM2/1/21
to RubyInstaller
Hi Helen!
I'm having the same problem. Did you find a solution?
I installed Ruby last week following instructions. The irb console flashes but closes immediately. The path for the System variable includes both java and ruby on my computer so that may not be the issue for me at least. Just curious if you have solved it?

Thanks
Sofie

helen judd

unread,
Feb 5, 2021, 4:10:34 PM2/5/21
to rubyin...@googlegroups.com
Hmm - it doesnt look like I have an env variable called HOME or IRB, I do have one called RUBYOPT....help?

On Fri, 5 Feb 2021 at 19:39, helen judd <helen...@googlemail.com> wrote:
Hi

No - I havent fixed it yet. I was trying to run it from C:\WINDOWS\system32 but just tried from c:\Users but that didn't help, going to try the env variables options now

Helen

--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyinstalle...@googlegroups.com.

helen judd

unread,
Feb 5, 2021, 4:10:37 PM2/5/21
to rubyin...@googlegroups.com
Hi

No - I havent fixed it yet. I was trying to run it from C:\WINDOWS\system32 but just tried from c:\Users but that didn't help, going to try the env variables options now

Helen

On Mon, 1 Feb 2021 at 18:19, Sofie Vigström <sof...@gmail.com> wrote:
--

Luis Lavena

unread,
Feb 15, 2021, 10:43:26 AM2/15/21
to RubyInstaller
  Hello Helen, Sofie,

Ruby (and IRB) will try to persist or read configuration options from your user's home directory. This location is detected by using environment variables set in your system. Normally on Windows, Ruby will use HOME variable if set, then fall back to HOMEDRIVE+HOMEPATH and finally fall back to USERPROFILE.

If for some reason these variables are set but point to a device that doesn't exist (like H: in your case), it could explain the error you're receiving.

This scenario is mentioned in RubyInstaller Troubleshooting page:

You can check these values by opening a Command Prompt Window and checking the values of HOME, HOMEDRIVE and HOMEPATH, for example, this is what I saw:

C:\Users\Luis>echo %HOME%
C:\Users\Luis

C:\Users\Luis>echo %HOMEDRIVE%
C:

C:\Users\Luis>echo %HOMEPATH%
\Users\Luis

cmd_n0ZhuLwCQe.png


If that shows H:, you might need to adjust HOME variable to something that matches your environment by using the System properties options:

SystemPropertiesAdvanced_6j2OcV7JKa.png
SystemPropertiesAdvanced_41iepRRdPR.pngSystemPropertiesAdvanced_IbzmyvC6JQ.png

Hope that helps.

Cheers,
Reply all
Reply to author
Forward
0 new messages