Disabling irb autocomplete on Heroku
Asked Answered
S

3

8

A follow up to Disable irb autocomplete

I would like to disable IRB on Heroku, e.g. having an .irbrc with:

IRB.conf[:USE_AUTOCOMPLETE] = false

In the home directory of my heroku dyno/server

How can I do it?

Salver answered 19/1, 2022 at 9:28 Comment(0)
L
7

Your application's root directory ends up being the application's user's home directory at Heroku so you could put a .irbrc in your application's root directory. So add your .irbrc with IRB.conf[:USE_AUTOCOMPLETE] = false to your app's root directory so that it looks like this:

$ cd your_app_root_directory
$ ls -1A
.git/
...
.irbrc # <-----------------
...
Gemfile
Gemfile.lock
Procfile
README.md
Rakefile
app/
bin/
config/
config.ru
db/
...

Then, once you push everything up to Heroku, heroku run console will use that .irbrc.

Leg answered 19/1, 2022 at 17:47 Comment(1)
It works! Actually I had tried that but didn't get it pushed to heroku yetSalver
R
10

If you don't want to update the .irbrc on Heroku because that would affect others' usage of it, you can also disable autocomplete on Heroku just for yourself via the command line when you open it. The quotes are critical, or you will get a Thor::InvocationError:

heroku run "rails console -- --noautocomplete"

Rimrock answered 17/5, 2022 at 19:37 Comment(1)
The heroku run version is not working for me, I'm still getting the autocompleteRobbirobbia
L
7

Your application's root directory ends up being the application's user's home directory at Heroku so you could put a .irbrc in your application's root directory. So add your .irbrc with IRB.conf[:USE_AUTOCOMPLETE] = false to your app's root directory so that it looks like this:

$ cd your_app_root_directory
$ ls -1A
.git/
...
.irbrc # <-----------------
...
Gemfile
Gemfile.lock
Procfile
README.md
Rakefile
app/
bin/
config/
config.ru
db/
...

Then, once you push everything up to Heroku, heroku run console will use that .irbrc.

Leg answered 19/1, 2022 at 17:47 Comment(1)
It works! Actually I had tried that but didn't get it pushed to heroku yetSalver
S
1

Create an .irbrc file with this content:

IRB.conf[:USE_AUTOCOMPLETE] = false
IRB.conf[:PROMPT_MODE] = :SIMPLE
Salver answered 19/1, 2023 at 18:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.