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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:04:16+00:00 2026-05-20T16:04:16+00:00

I have the following code: http://scrp.at/FB # Error: # bin/rpg:5:in `<main>’: uninitialized constant RubyPasswordGenerator::Korben

  • 0

I have the following code: http://scrp.at/FB

# Error:
# bin/rpg:5:in `<main>': uninitialized constant RubyPasswordGenerator::Korben (NameError)

In file “bin/rpg”

#!/usr/bin/env ruby

require_relative "../lib/ruby_password_generator"

puts RubyPasswordGenerator::Korben.new

In “lib/ruby_password_generator.rb”

require_relative "ruby_password_generator/ruby_password_generator"
require_relative "ruby_password_generator/password_generator"
require_relative "ruby_password_generator/version"

# DEBUG
require "pp"

module RubyPasswordGenerator
end

require_relative "ruby_password_generator/algo/korben"

In “algo/korben.rb”

module RubyPasswordGenrator

  class Korben

    M_LOWERCAS_LETTERS    = ("a".."z").to_a
    M_UPPERCASE_LETTERS   = ("A".."Z").to_a
    M_NUMBERS             = (0..9).to_a
    M_SPECCIAL_CHARACTERS = "!@#()_-+=[]{}".split("")

    def initialize(length = 42)
      raise ArgumentError unless length.is_a?(Integer)
      raise ArgumentError unless length >= 3 && length <= 255

      @length = length
    end

    def generate
      password = ""
      (0...@length).each do
        char = (M_LOWERCAS_LETTERS + M_UPPERCASE_LETTERS + M_NUMBERS + M_SPECCIAL_CHARACTERS).shuffle.sample
        password << char
      end

      password
    end

  end
end

The file structure looks like:

# .
# ├── Gemfile
# ├── Gemfile.lock
# ├── LICENSE.markdown
# ├── NERD_tree_3
# ├── README.markdown
# ├── Rakefile
# ├── bin
# │   └── rpg
# ├── lib
# │   ├── ruby_password_generator
# │   │   ├── algo
# │   │   │   ├── korben.rb
# │   │   │   └── marvin.rb
# │   │   ├── helpers
# │   │   ├── password_generator.rb
# │   │   ├── ruby_password_generator.rb
# │   │   └── version.rb
# │   └── ruby_password_generator.rb
# ├── ruby_password_generator.gemspec
# └── spec
#     ├── algo
#     │   ├── korben_spec.rb
#     │   └── marvin_spec.rb
#     ├── password_generator_spec.rb
#     ├── ruby_password_generator_spec.rb
#     └── spec_helper.rb
#
# 7 directories, 19 files

I really don’t know why I am getting an uninitialized constant “NameError” error. I included the file properly using require_relative. I also tried autoload and require, but that didn’t solve anything. I am using ruby 1.9.2-p180.
If anybody knows what’s going on please explain me.

  • 1 1 Answer
  • 2 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-20T16:04:16+00:00Added an answer on May 20, 2026 at 4:04 pm
    module RubyPasswordGenrator
      class Korben
    

    You’re missing an e in the module name. Thus the Korben class exists in the RubyPasswordGenrator module not the RubyPasswordGenerator module and RubyPasswordGenerator::Korben does indeed not exist.

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

Sidebar

Related Questions

I have the following code that returns HTTP error 400 everytime I try to
I have the following code http://bc.coverstar.com/images/error.gif Why am I getting a syntax error after
I have the following code: http://jsfiddle.net/uRCL2/1 At the moment the result is shown in
I have the following code setup: http://jsfiddle.net/bABHU/2/ Had to change it a little bit
I have problems with following code: http://lisper.ru/apps/format/96 The problem is in normalize function, which
I have the following code: $file = 'http://3.bp.blogspot.com/-AGI4aY2SFaE/Tg8yoG3ijTI/AAAAAAAAA5k/nJB-mDhc8Ds/s400/rizal001.jpg'; $newfile = '/img/submitted/yoyo.jpg'; if ( copy($file,
I have the following code: String website = http://www.somewebsite.com/; Document doc = Jsoup.connect(website).get(); Elements
I have the following code that works on PHP5 to send a HTTP POST
I have the following code to open google maps: NSString *urlString = [NSString stringWithFormat:@http://maps.google.com/maps?q=%@,
I have the following code that is working fine in jsfiddle - http://jsfiddle.net/darkajax/FHZBy/ I've

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.