deivid-rodriguez / byebug

Debugging in Ruby 2
BSD 2-Clause "Simplified" License
3.34k stars 328 forks source link

Errno::EBADF (Bad file descriptor) #717

Open linojon opened 4 years ago

linojon commented 4 years ago

hi, i created a new Rails 6 project, add byebug in a controller, and always get this error (even in the simplest WelcomController#index). Using byebug gem 11.1.3

Completed 500 Internal Server Error in 13ms (ActiveRecord: 0.0ms | Allocations: 108973) Errno::EBADF (Bad file descriptor):

Can you help me get this going?

linojon commented 4 years ago

fyi i also tried $ byebug triangle.rb and get a similar error. Using ruby 2.6.6p146 (2020-03-31 revision 67876) [x64-mingw32] on Windows 10

Jonathan@Jons-MSI-GS65 MINGW64 /d/Documents/RailsProjects $ byebug triangle.rb

[1, 10] in D:/Documents/RailsProjects/triangle.rb 1: # 2: # The n'th triangle number: triangle(n) = n*(n+1)/2 = 1 + 2 + ... + n 3: # => 4: def triangle(n) 5: tri = 0 6: 7: 0.upto(n) { |i| tri += i } 8: 9: tri 10: end

Γû╜Bad file descriptor ["C:/Ruby26-x64/lib/ruby/site_ruby/reline/ansi.rb:105:in raw'", "C:/Ruby26-x64/lib/ruby/site_ruby/reline/ansi.rb:105:incursor_pos'", "C:/Ruby26-x64/lib/ruby/site_ruby/reline.rb:345:in may_req_ambiguous_char_width'", "C:/Ruby26-x64/lib/ruby/site_ruby/reline.rb:207:ininner_readline'", "C:/Ruby26-x64/lib/ruby/site_ruby/reline.rb:187:in readline'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/forwardable-1.3.1/lib/forwardable.rb:235:inreadline'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/interfaces/local_interface.rb:24:in block (2 levels) in readline'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/interfaces/local_interface.rb:57:inwithout_readline_completion'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/interfaces/local_interface.rb:24:in block in readline'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/interfaces/local_interface.rb:36:inwith_repl_like_sigint'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/interfaces/local_interface.rb:24:in readline'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/interface.rb:71:inprepare_input'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/interface.rb:55:in read_input'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/interface.rb:38:inread_command'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/processors/command_processor.rb:128:in repl'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/processors/command_processor.rb:97:inprocess_commands'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/processors/command_processor.rb:55:in at_line'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/context.rb:98:inat_line'", "D:/Documents/RailsProjects/triangle.rb:4:in <top (required)>'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/runner.rb:186:indebug_load'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/runner.rb:186:in debug_program'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/runner.rb:103:inblock in run'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/runner.rb:102:in loop'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/lib/byebug/runner.rb:102:inrun'", "C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/byebug-11.1.3/exe/byebug:6:in <top (required)>'", "C:/Ruby26-x64/bin/byebug:23:inload'", "C:/Ruby26-x64/bin/byebug:23:in `

'"]

HaiderBajwa111 commented 3 years ago

I was using gitbash and geting the same error but as I use windows command prompt I did not get this error