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

  • Home
  • SEARCH
  • 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 8181581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:34:25+00:00 2026-06-07T00:34:25+00:00

I am in the ruby console, and I am trying to invoke a method

  • 0

I am in the ruby console, and I am trying to invoke a method and I am not getting the syntax right.

Here is the structure of the file:

module App
  module Tools
    module Pollers
      class Kpi
        attr_reader :start_time,:stop_time

        def initialize(start_time,stop_time)
          @start_time = start_time
          @stop_time = stop_time
        end
        .....

and I am trying to invoke this in the console like this:

?> kpi = App::Tools::Pollers::Kpi.initialize(start,end_date)
SyntaxError: compile error
(irb):17: syntax error, unexpected tCONSTANT, expecting kDO or '{' or '('

Would someone be able to point me to the right syntax for invoking the initialize ?

Thanks!

  • 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-06-07T00:34:26+00:00Added an answer on June 7, 2026 at 12:34 am

    Judging by the error message, the problem is elsewhere, but you’ll probably want Kpi.new, not Kpi.initialize.

    Well, apparently it’s not elsewhere 🙂

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

Sidebar

Related Questions

I get this error when trying ruby script/console Rails requires RubyGems >= . Please
I'm trying to debug simple ruby file in Aptana 3. class HelloWorld def initialize()
I'm trying to start the console (irb) in Ruby 1.9 with Rails 2.3.4. I
I'm trying to launch a heroku console that uses rubygems but I keep getting
Trying to parse and XLSX file using roo gem in a ruby script. In
I'm digging around trying to find a good set of tools for creating console
I am trying to run a ruby debugger in Eclipse. I have not run
I am trying to add the following method to the Math class in Ruby
I'm importing a CSV file into Ruby (1.8.7). File.open('path/to/file.csv').read returns this in the console:
When trying to launch the rails console after updating my ruby setup using 'sudo

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.