# LiveConsole 0.1.0 -- eval code against a running program with IRB

**URL:** <https://www.ruby-forum.com/t/liveconsole-0-1-0-eval-code-against-a-running-program-with-irb/117824>\
**Category:** Ruby\
**Created:** [October 20, 2007, 10:29pm UTC](https://www.ruby-forum.com/t/liveconsole-0-1-0-eval-code-against-a-running-program-with-irb/117824 "2007-10-20T22:29:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pete\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a9adbd/32.png) [@Pete\_E](https://www.ruby-forum.com/u/Pete_E)\
**Post date:** [October 20, 2007, 10:29pm UTC](https://www.ruby-forum.com/t/liveconsole-0-1-0-eval-code-against-a-running-program-with-irb/117824/1 "2007-10-20T22:29:11Z")

</div>

I quit my job, and that can only mean one thing: time to release a new  
gem.

About:

LiveConsole is a library for providing IRB over a TCP connection . If  
you add it to your application, you can run arbitrary code against  
your application. For example, you can:  
\* Inspect the state of a running application  
\* Change the state of the application  
\* Patch code on the fly, without a restart.  
\* Let anyone on the net 0wn you if you bind to anything other  
than  
localhost. 🙂  
It’s useful as a diagnostic tool, a debugging tool, and a way to  
impress your friends or get those Lisp guys off your back. You know  
the ones I mean.

Installation:

```
    gem install live_console

```

There’s also [rubyforge.org/projects/live-console](http://rubyforge.org/projects/live-console) , which has tar’d  
source.

Usage:

```
    lc = LiveConsole.new 1337 # Creates a LiveConsole on port 1337

```

Not yet accepting connections.  
lc.run # Starts the LiveConsole thread  
At this point, users can connect and get an IRB prompt. It happens in  
a different thread, so you get control back.  
lc.stop # Kills the LiveConsole thread  
Now, no one can connect.

Status:

It’s alpha software for now. There are some things missing, like an  
authentication mechanism, some of the niceness of IRB on a real  
console (readline, being able to hit ^D, etc.), the ability to use a  
named pipe instead of TCP. There shouldn’t be any weird failures, but  
I’m not ruling them out.

---

<div class="post-metadata">

**Author:** ![Pete\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a9adbd/32.png) [@Pete\_E](https://www.ruby-forum.com/u/Pete_E)\
**Post date:** [October 20, 2007, 10:40pm UTC](https://www.ruby-forum.com/t/liveconsole-0-1-0-eval-code-against-a-running-program-with-irb/117824/2 "2007-10-20T22:40:52Z")

</div>

On Sun, 21 Oct 2007 05:28:42 +0900, Pete E. wrote:

> LiveConsole is a library for providing IRB over a TCP connection . If  
> you add it to your application, you can run arbitrary code against  
> your application. For example, you can:  
> \* Inspect the state of a running application  
> \* Change the state of the application  
> \* Patch code on the fly, without a restart.

That’s beautiful! Does it work with Rails and/or ruby-debug? All three  
together would be the holy grail for debuggability.

---

<div class="post-metadata">

**Author:** ![Pete\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a9adbd/32.png) [@Pete\_E](https://www.ruby-forum.com/u/Pete_E)\
**Post date:** [October 21, 2007, 2:13am UTC](https://www.ruby-forum.com/t/liveconsole-0-1-0-eval-code-against-a-running-program-with-irb/117824/3 "2007-10-21T02:13:01Z")

</div>

I haven’t tested it very thoroughly on Rails, but it seems to work.  
It has the added (possible) benefit of not stopping the application  
when you use it, unlike Rails’ breakpoint code. As long as you don’t  
interfere with running Controllers, it should be fine. YMMV
