# Strange behaviour in IRB using # sign

**URL:** <https://www.ruby-forum.com/t/strange-behaviour-in-irb-using-sign/130803>\
**Category:** Ruby\
**Created:** [March 3, 2008, 2:41pm UTC](https://www.ruby-forum.com/t/strange-behaviour-in-irb-using-sign/130803 "2008-03-03T14:41:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![extempore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/6bbea6/32.png) [@extempore](https://www.ruby-forum.com/u/extempore)\
**Post date:** [March 3, 2008, 2:41pm UTC](https://www.ruby-forum.com/t/strange-behaviour-in-irb-using-sign/130803/1 "2008-03-03T14:41:06Z")

</div>

Hi all,

I’m using IRB in a DOS box on Windows XP. I’m experiencing problems with  
the  
‘#’ sign.

When typing the ‘#’ sign, IRB puts the sign in front of the line, so the  
whole  
line changes into a comment. Afterwards it shows a new prompt.

Here is an example:

I want to type this:

a = 1  
b = " #{a}"

When typing this in IRB I get:

irb(main):001:0\> a = 1  
=\> 1  
irb(main):002:0\> #b = "  
irb(main):003:0\* {a}"  
irb(main):004:0"

From the moment I type the ‘#’ sign, this sign gets placed before the b  
variable.

This makes IRB almost unusable for me ☹

If I use eval.rb it works fine:

ruby\> a = 1  
1  
ruby\> b = " #{a}"  
" 1"  
ruby\>

Is this bug in IRB or Windows? What can I do about it?

Many thanks in advance,  
Paul.

---

<div class="post-metadata">

**Author:** ![extempore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/6bbea6/32.png) [@extempore](https://www.ruby-forum.com/u/extempore)\
**Post date:** [March 3, 2008, 5:26pm UTC](https://www.ruby-forum.com/t/strange-behaviour-in-irb-using-sign/130803/2 "2008-03-03T17:26:55Z")

</div>

On Mon, Mar 3, 2008 at 2:39 PM, Paul P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> When typing this in IRB I get:
> 
> irb(main):001:0\> a = 1  
> =\> 1  
> irb(main):002:0\> #b = "  
> irb(main):003:0\* {a}"  
> irb(main):004:0"

It works fine on my machine(XP, Ruby 1.8.6):  
irb(main):001:0\> a = 1  
=\> 1  
irb(main):002:0\> b = " #{a}"  
=\> " 1"  
irb(main):003:0\> VERSION  
=\> “1.8.6”  
irb(main):004:0\>

---

<div class="post-metadata">

**Author:** ![extempore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/6bbea6/32.png) [@extempore](https://www.ruby-forum.com/u/extempore)\
**Post date:** [March 3, 2008, 11:30pm UTC](https://www.ruby-forum.com/t/strange-behaviour-in-irb-using-sign/130803/3 "2008-03-03T23:30:13Z")

</div>

On Mon, Mar 3, 2008 at 7:39 AM, Paul P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> irb(main):002:0\> #b = "  
> irb(main):003:0\* {a}"  
> irb(main):004:0"
> 
> From the moment I type the ‘#’ sign, this sign gets placed before the b variable.
> 
> This makes IRB almost unusable for me ☹

Maybe you should show your versions, and what you use for Ruby (like  
one-click install, cygwin, or mingw). That might allow people to help  
you a little.

Todd

---

<div class="post-metadata">

**Author:** ![extempore](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/6bbea6/32.png) [@extempore](https://www.ruby-forum.com/u/extempore)\
**Post date:** [March 4, 2008, 3:50pm UTC](https://www.ruby-forum.com/t/strange-behaviour-in-irb-using-sign/130803/4 "2008-03-04T15:50:55Z")

</div>

Hi,

Thanks for the responses.

I’m using Ruby version 1.8.4. It is installed from a one-click  
installer,  
called 184-20, distributed by “The RubyInstaller Team”.

My work environment is a virtual machine with Windows XP running on  
VMWare 5.5.2.

Thanks,  
Paul.
