Bunny: Ruby IRB auto-completion issue

It was brought to my attention by Sho Fukamachi that a repeatable error occurs when trying to use IRB auto-completion with Bunny in some versions of Ruby 1.8.6 and 1.8.7. The problem does not occur in Ruby 1.9.1 and seems to have been fixed in Ruby 1.8.6 p287.

In your IRB session, if you see something like the following  –


q.me/Users/chrisduncan/ruby186/lib/ruby/1.8/irb/completion.rb:159: can't convert Symbol
into String (TypeError) ...

It appears to be a bug in irb/completion.rb. I applied the following patch to fix it –

Change the line:


/^(IRB|SLex|RubyLex|RubyToken)/ =~ name

To:


/^(IRB|SLex|RubyLex|RubyToken)/ =~ name.to_s

Personally, I would advise installing an officially patched version of Ruby to remedy the issue. However, as always, the choice is yours.

Update (21/07/2011)

As a result of further investigation there is a remedy to this issue that has been implemented in Bunny. It will be included in the next release of the gem, however, if you need to get a patched version more quickly, both the 0.7.x-stable and master branches on GitHub include the patch.

Advertisements

3 thoughts on “Bunny: Ruby IRB auto-completion issue

    1. Chris Duncan Post author

      Sorry Michael, I have not come up with a remedy in Bunny. However, now that development of Bunny is continuing maybe a solution can be found that does not involve patching Ruby IRB.

      Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s