Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jirb does not find .irbrc on Windows in "My Documents" #3675

Open
rovf opened this issue Feb 17, 2016 · 3 comments
Open

Jirb does not find .irbrc on Windows in "My Documents" #3675

rovf opened this issue Feb 17, 2016 · 3 comments

Comments

@rovf
Copy link

rovf commented Feb 17, 2016

https://github.com/jruby/jruby/wiki/GettingStarted#jirb-ruby-interactive-console states:

If you're on Windows, it goes in your My Documents folder or the folder specified in the HOME environment variable.

I have put a .irbrc file into my "My Documents" folder, containing the following lines:

STDOUT.puts "This is the .irbrc in 'My Documents'" $foo=555
I'm invoking jirb as c:\jruby-1.7.23\bin\jirb.bat

Neither the text is output, nor is the variable $foo set. I conclude, that my .irbrc has not been loaded.

@djberg96
Copy link
Contributor

djberg96 commented Mar 8, 2016

I think the doc is bad. Just put it in your home directory. The trick is that ENV['HOME'] needs to be set.

set HOME=%USERPROFILE% # cmd shell
$env:HOME = $env:USERPROFILE # powershell

Once that's done (and you've put your irbrc file there) it should work.

@rovf
Copy link
Author

rovf commented Mar 9, 2016

If I need to set a particular environment variable for this, wouldn't it maybe a more logical recommendation, to write in the docs that the variable IRBRC should be used? This variable is recognized on every platform. The docs could say - for instance: "If you are on Windows, which does not have the concept of a home directory, set the environment IRBRC to the absolute path of your .irbrc file".

@djberg96
Copy link
Contributor

djberg96 commented Mar 9, 2016

True, it does look for IRBRC first, but either will work. Yes, the docs should be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants