nonsequitur / inf-ruby

218 stars 69 forks source link

inf-ruby buffer doesn't get response #51

Closed stardiviner closed 10 years ago

stardiviner commented 10 years ago

When I open inf-ruby buffer and switch to it with [C-c C-s]. input puts "hi". The process doesn't give response with anything.

Is there a way to debug this?

I tried with emacs -Q and emacs -q. And load inf-ruby. repeat upper same steps, still no response.

dgutov commented 10 years ago

Works for me. Are you using the plain irb as interpreter?

Maybe try removing everything from your .irbrc, or edebug through ruby-send-definition.

stardiviner commented 10 years ago

@dgutov I checked out Emacs debug manual, https://www.gnu.org/software/emacs/manual/html_node/eintr/Debugging.html#Debugging

I tried some of them, (because I can't understand all of them) like debug-on-quit, edebug-defun, eval and to next stop. etc.

So can you show more details about how to debug my issue?

dgutov commented 10 years ago

So can you show more details about how to debug my issue?

Not much. I don't have any specific ideas about what might be going wrong on your system. So you can try to walk through the execution of ruby-send-definition and understand what's going on (jump into ruby-send-region, and so on).

Note that you still haven't responded to the rest of my previous message.

dgutov commented 10 years ago

http://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Edebug.html https://www.gnu.org/software/emacs/manual/html_node/eintr/edebug.html#edebug

stardiviner commented 10 years ago

I have not set .irbrc file.

stardiviner commented 10 years ago

And what is plain irb ? (with out custom configuration on irb?). Yes. I have not set any special on irb.

dgutov commented 10 years ago

Okay. What's your OS and version of Emacs?

stardiviner commented 10 years ago

Ubuntu 14.04 (x86_64), Emacs version: 24.3.50.1

MgaMPKAy commented 10 years ago

I came across a similar problem. Now, I start irb with --inf-ruby-mode.

dgutov commented 10 years ago

@MgaMPKAy Interesting. What's your Ruby version?

MgaMPKAy commented 10 years ago
$ ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]

$ irb -v
irb 0.9.6(09/06/30)

Actually, I add IRB.conf[:PROMPT_MODE] = :INF_RUBY to ~/.irbrc.

stardiviner commented 10 years ago

Right, append option --inf-ruby-mode solved my issue.

stardiviner commented 10 years ago

@MgaMPKAy thanks

dgutov commented 10 years ago

@stardiviner @MgaMPKAy How do your prompts look, without that option?

Does --noreadline help, instead?

Continuation prompts, which --inf-ruby-mode disables, look quite useful to me.

stardiviner commented 10 years ago

Yes, --noreadline helps, without --inf-ruby-mode.

dgutov commented 10 years ago

Great. I see no reasons not to include this flag, then.

stardiviner commented 10 years ago

@dgutov I got this problem again on console-rails. When I run command inf-ruby-console-auto, and it raise up the prompt head :001>. But it suspended when I execute statement puts "hi". I have tested without my init files. with emacs -q and load inf-ruby with (load "~/.emacs.d/el-get/inf-ruby/inf-ruby.el"). My Emacs version: 24.3.50.1 System: Ubuntu Linux x86_64 Rails version: 4.1.4 Use RVM.

dgutov commented 10 years ago

Have you tried putting

IRB.conf[:USE_READLINE] = nil

into your ~/.irbrc?

stardiviner commented 10 years ago

@dgutov Thanks, it's solved. And it's false, not nil. I think this should be put in README as FAQ.

dgutov commented 10 years ago

Doesn't it work with nil? That's the value the doc suggests: http://www.ruby-doc.org/stdlib-2.0/libdoc/irb/rdoc/IRB.html#module-IRB-label-Configuration

I think this should be put in README as FAQ.

Ok, I will. Of course, if someone would actually find out the cause of the problem you're having, they might offer a better solution.

stardiviner commented 10 years ago

@dgutov No, not work with nil. I have tested.

dgutov commented 10 years ago

I see.

I think this should be put in README as FAQ.

Not as FAQ, but it's in the README now.