Ruby rail debug output

Posted by Darkerstar on Stack Overflow See other posts from Stack Overflow or by Darkerstar
Published on 2010-03-24T07:56:03Z Indexed on 2010/03/24 8:03 UTC
Read the original article Hit count: 582

Filed under:
|
|

Hi all:

I am just starting to write ruby rails. I wrote a controller but is getting wrong number of "arguments (1 for 0)" error, I can't understand why. It has no information on where the error occurred? It has a full list of stack traces but my controller file is not in there!

In my controller I have just two methods, that I was going to test out activemq. But after I put the controller out, I got the above error, so I commented out all the code, but I still get the same error. I can't figure out why.

I searched google for ruby debug, I have not found anything helpful.

Here is my controller source:

class ActivemqTestController < ApplicationController
  def send
    #client = Stomp::Client.open("stomp://localhost:61613")
    #station_id=101
    #data = {'station_id' => station_id, 'username' => 'yangyanzhe'}
    #client.publish('/listener/add', data)
  end

  def receive
    #client = Stomp::Client.open("stomp://localhost:61613")
    # Processing loop
    #client.subscribe('/listener/add', headers) do |msg|
      # Process your message here
      # Your submitted data is in msg.body
      #puts msg['username'] + " joined " + msg['station_id'] + "\n"
      #client.acknowledge(msg)
    #end
    #client.join # Wait until listening thread dies
  end
end

This is the error:

ArgumentError in Activemq testController#index

wrong number of arguments (1 for 0)
RAILS_ROOT: D:/rubyapps/radio

Application Trace | Framework Trace | Full Trace
f:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `send'
f:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `process_without_filters'
f:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:606:in `process'
f:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:in `process'
f:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:in `call'
f:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:437:in `call'

Thank you for any help in advance.

© Stack Overflow or respective owner

Related posts about ruby

Related posts about rails