Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5953103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:46:36+00:00 2026-05-22T17:46:36+00:00

This is a bit hard to explain, but I seem to be occasionally unable

  • 0

This is a bit hard to explain, but I seem to be occasionally unable to override the ‘send’ method in my application. I’m creating a fairly large application based on EventMachine and sometimes, deep in the bowels of my code, I decide to define a ‘send’ method in one of my classes. When I later attempt to use this method, I normally get an exception that looks something like TypeError: <parameter> is not a symbol, such as the following (happens to be caused by the required AMQP gem (not mine), but this question is more general):

Exception caught: TypeError - #<AMQ::Protocol::MethodFrame:0x000001008434f0 @payload="\x002\x00\x14\x00\x00\x01a\tamq.topic\x00\x01\x00\x00\x00\x00", @channel=1> is not a symbol
/Users/mlartz/.rvm/gems/ruby-1.9.2-p180@rflow-component-devel/gems/amq-client-0.7.0.alpha27/lib/amq/client/queue.rb:137:in `bind'
/Users/mlartz/.rvm/gems/ruby-1.9.2-p180@rflow-component-devel/gems/amqp-0.8.0.rc12/lib/amqp/queue.rb:282:in `block in bind'
/Users/mlartz/.rvm/gems/ruby-1.9.2-p180@rflow-component-devel/gems/eventmachine-1.0.0.beta.3/lib/em/deferrable.rb:47:in `call'
/Users/mlartz/.rvm/gems/ruby-1.9.2-p180@rflow-component-devel/gems/eventmachine-1.0.0.beta.3/lib/em/deferrable.rb:47:in `callback'

This is the offending line:

@connection.send(Protocol::Queue::Bind.encode(@channel.id, @name, exchange_name, routing_key, nowait, arguments))

In this particular case, the @connection object’s class has defined a send method that takes in an AMQ::Protocol::MethodFrame. It seems, however, that somehow the default Object#send method is getting called (which expects a symbol, hence the exception).

Earlier in development, I had the same issue on one of my custom classes, which was solved by changing the name of my ‘send’ method to ‘send_message’.

So, as this is a bit general, the question is, what sorts of things could interfere with my ability to call a custom-defined send method on the object that defined it?

FYI: I’m using Ruby 1.9.2p180 on OSX.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:46:37+00:00Added an answer on May 22, 2026 at 5:46 pm

    It is not recommendable to use or override the send method. Object.send is a very basic method in the Ruby Kernel Module. I once got heavy problem when I defined a Message.send class, and ended up in using a different name, such as Message.transmit. In Ruby on Rails it is a reserved word.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is something that I always find a bit hard to explain to others:
This is going to be fairly hard to explain, so I've put together a
This is a bit hard to explain. I have a website with a lot
Ok, this is bit of an obscure question, but hopefully someone can help me
here's what I need (it's a bit hard to explain): I have 2 window
I have this bit of javascript written with jQuery 1.2.5. It's contained inside the
I have this bit of script to widen a text box on mouseover and
I have this bit of code I found on the web at the end
I'm trying to understand this bit of code: in display.php: <html> ... <body> <table>
Well, I have this bit of code that is slowing down the program hugely

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.