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 8250783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:00:56+00:00 2026-06-08T00:00:56+00:00

I followed this tutorial to create a simple command-line gem and now I want

  • 0

I followed this tutorial to create a simple command-line gem and now I want to extend functionality with raad. Currently I have made the following changes after following the tutorial:

bin/zerp:

#!/usr/bin/env ruby

require 'zerp'

class Zerp    
  def start
    Raad::Logger.debug 'zerp started'

    EventMachine.run do
      EventMachine.add_periodic_timer(1) do
        Raad::Logger.info 'zerp is running'
      end
    end
  end

  def stop
    EventMachine.stop
    Raad::Logger.debug 'zerp stopped'
  end
end

lib/zerp.rb:

require 'zerp/version'

require 'eventmachine'
require 'raad'

module Zerp
end

When I run the client from commandline I get the following error.

user@zenbook:~/git/zerp :) zerp
/home/user/.local/lib/ry/rubies/1.9.3-p194/lib/ruby/gems/1.9.1/gems/zerp-0.0.1/bin/zerp:5:in `<top (required)>': Zerp is not a class (TypeError)
    from /home/user/.local/lib/ry/current/bin/zerp:23:in `load'
    from /home/user/.local/lib/ry/current/bin/zerp:23:in `<main>'
user@zenbook:~/git/zerp :( 

What is the proper approach to get this working?

  • 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-08T00:00:57+00:00Added an answer on June 8, 2026 at 12:00 am

    This is a use-case I did not really look into when making Raad and only minor modifications will make it better integrate within a “executable” gem context. In the meantime you can use this workaround:

    bin/zerp

    #!/usr/bin/env ruby
    
    begin
      require 'zerp'
    rescue LoadError
      $:.unshift 'zerp/lib'
      require 'zerp'
    end
    
    # raad must be required after the Zerp class definition
    require 'raad'
    

    zerp/lib/zerp.rb

    require "zerp/version"
    require "zerp/service"
    

    zerp/lib/service.rb

    require 'eventmachine'
    
    class Zerp    
      def start
        Raad::Logger.debug 'zerp started'
    
        EventMachine.run do
          EventMachine.add_periodic_timer(1) do
            Raad::Logger.info 'zerp is running'
          end
        end
      end
    
      def stop
        EventMachine.stop
        Raad::Logger.debug 'zerp stopped'
      end
    end
    

    zerp/lib/version

    module ZerpModule
      VERSION = "0.0.1"
    end
    

    The way Raad works right now is that since the file requiring the raad gem is “zerp” then Raad tries to bootstrap using the “Zerp” class. To avoid conflicts you should use another module name than “Zerp” – I just picked “ZerpModule”.

    I’ll try to make a fix shortly to have Raad integrate better in a gem context.

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

Sidebar

Related Questions

I have followed this tutorial which allowed me to create a Silverlight DataGrid that
I followed this tutorial and I'm currently trying to create a class to draw
I have followed a tutorial to create a simple blog writing application in PHP
I have followed this tutorial to create a seek bar on a transparent background.
I want to create a simple TabActivity and followed the tutorial on the developer
I have followed this tutorial http://blogs.wrox.com/article/creating-a-simple-ipad-application-table-view/ (creating a uitableview and populating it). I want
I have followed this tutorial to create the first azure application http://msdn.microsoft.com/en-us/WAZPlatformTrainingCourse_IntroToWindowsAzureLabVS2010 Because after
I have followed this nice video tutorial to create a mini MVC PHP framework.
I'm trying to create a JAX-WS webservice with security enabled. I followed this tutorial
I followed this tutorial to implement facebook into my application. All I want is

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.