778 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
1
answer
76
views
Ruby irb: Autocomplete-usage leads to crash
I start typing on the console and a list with the feasible options appears. Then I use the tabulator-key for going through the options.
Immediately irb crashed and exits. I'm on the console again.
...
1
vote
1
answer
123
views
How do I recover access to my Rails console?
I've been working on a simple administrative app for more than a year (yes, I'm slow) it is intended for micro business in Mexico, however, last Friday I tried to improve colors for my irb terminal ...
2
votes
1
answer
124
views
IRB no longer allows submitting multi-line input on Enter
$ irb
>> IRB::VERSION #=> "1.15.2"
>> Reline::VERSION #=> "0.6.1"
# add a method
def test
"test"
end
# then arrow up to edit the method, and try ...
Alex's user avatar
- 31.3k
1
vote
1
answer
177
views
Make interactive ruby REPL display results for consecutive commands, not only the last?
If I run this
a = "hello"
b = "world"
a
b
in ruby
irb(main):007> a = "hello"
=> "hello"
irb(main):008> b = "world"
=> "world"
...
0
votes
1
answer
146
views
How can I automatically set an IRB configuration across all environments for a specific Ruby on Rails application?
I'd like to set an IRB configuration across an application (all environments, including production), so I don't have to run it every time I use the Ruby on Rails console. The specific configuration ...
1
vote
1
answer
344
views
Configuring the console via IRB
I have some code that I would like to automatically execute on a per-project basis when I start up rails c. In one of my Rails 6 projects, I just created a .irbrc file at the top-level of the project, ...
0
votes
3
answers
89
views
How to get the path of a file without normalisation in ruby?
My current directory path is /a/b/c/
When I do
fname = File.path("../test.rb")
::File.absolute_path(fname)
output is: /a/b/test.rb
What I am expecting is the output something like this: /...
3
votes
2
answers
251
views
Stop Rails IRB and debugger sharing history
Since I moved to Rails 7.1 and Ruby 3, I am struggling to use the Rails console history.
Previously, the console kept its own history, and the debugger history was separate. So if I was debugging a ...
0
votes
0
answers
77
views
ruby `pry`: can I edit classes defined on the REPL?
Context: exploratory experimenting written directly in the REPL.
In pry, if I type edit fn_name I can open the definition of fn_name in an editor and change it. Say:
def fn_name
puts 'fn_name'
end
...
-1
votes
2
answers
199
views
Why Visual studio don't give me an output?
i'm newbie in Ruby. Today i was coding some home exercise and founding this behavior of my code: if i try to execute the same code in irb and VSC in second case i don't get a single string of output.
...
0
votes
1
answer
38
views
Prevent Rails console from removing consecutive linebreaks
I'd like to prevent the Rails console from removing consecutive linebreaks:
CoolApp (PRODUCTION) > a = '
CoolApp (PRODUCTION) " hi
CoolApp (PRODUCTION) "
CoolApp (PRODUCTION) "
...
0
votes
1
answer
85
views
IRB Keyboard Shortcuts are disabled? Can these be re-enabled? What did I break?
Expected behavior:
Keyboard shortcuts using readline shortcuts like this answer.
What actually happens: Ctrl+l is pressed to clear the screen
irb
2023年08月08日 20:31:17 -0600
Loaded Profile methods
irb....
1
vote
2
answers
198
views
How can remove multiline output with Rails console (Rails 6.1.7.2/Ruby 3.1.2)?
After upgrading to Rails 6.1.7.2 and Ruby 3.1.2, the way ActiveRecords are displayed in the output of the rails console is really annoying me. Basically, each record's attributes and values are ...
5
votes
2
answers
476
views
Rails 7 IRB console inserts escape key instead of execute delete command
I am using Mac OS and since latest rails version the delete key does not work anymore.
❯ rails -v
Rails 7.0.4
❯ ruby -v
ruby 3.1.2p20 (2022年04月12日 revision 4491bb740a) [arm64-darwin21]
When I hit ...
0
votes
1
answer
54
views
What is the traceback/local jumpback error in irb repl when writing multiline code?
I am a newbie, forgive if this is an obvious question but does anyone know why my irb repl isn't able to do multilines? I have tried lots of different if statements (copied from course notes that I am ...