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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:37:11+00:00 2026-05-24T09:37:11+00:00

I am trying to obscure the user input (for example, when inputting a password)

  • 0

I am trying to obscure the user input (for example, when inputting a password) for a ruby script. I’ve tried using both the ‘password’ gem and ‘highline/import’ gem, as suggested by this stack overflow article. However, I seems to be having some issues getting the gems to work. When my script is simply:

require 'password'
require 'rubygems'
require 'activesupport'

it outputs the following errors.

C:\Users\username\Desktop>ruby test.rb
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load --
activesupport (LoadError)
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/password-1.3/lib/password.rb:1:
in `<top (required)>'
        from <internal:lib/rubygems/custom_require>:33:in `require'
        from <internal:lib/rubygems/custom_require>:33:in `rescue in require'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from test.rb:1:in `<main>'

I’m not sure that ‘activesupport’ is necessary; I added it because of the first error line and it hasn’t seemed to help. I tried looking at the rdoc information found in the RubyGems Documentation Server and looking up each of the individual lines, but still cannot quite grasp what the problem is. I am using Ruby 1.9.2p180 on a Windows environment. Any insight would be much appreciated. Thank you in advance.

EDIT —
After following the advice of Casper, and installing the highline/import gem (gem install highline), I was able to find the following solution to my ultimate goal of obscuring password input:

require 'rubygems'
require 'highline/import'

username = ask("Enter username:  ") { |x| x.echo = true }
password = ask("Enter password:  ") { |x| x.echo = "*" } #assign false to echo nothing

which produces the following:

Enter username: Joe
Enter password: *********

Thanks Casper!

  • 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-24T09:37:11+00:00Added an answer on May 24, 2026 at 9:37 am

    You need to load rubygems before you try to load any other gem files. rubygems is what enables your Ruby programs to load other gems with require:

    require 'rubygems'
    require 'password'
    require 'activesupport'
    

    Before you can use the password gem however you need to install it:

    gem install ruby-password
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well, here's a nice obscure one. I'm trying to compile the latest open transport
Trying to create a QtRuby application, I get the following error: /usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation
Trying to do this sort of thing... WHERE username LIKE '%$str%' ...but using bound
I am trying to set up some useful coding templates in vim, for example
My real-life example is too obscure to explain, but this is a pretty good
I am trying to write an interface between RSPEC (ruby flavoured BDD) and a
So we're trying to set up replicated repositories using PlasticSCM, one in the US,
I was trying to come up with obscure test cases for an alternative open-source
I am using Flex and Bison to create a compiler. As I am trying
This is a bit of an obscure issue, but I'm using jQuery Sortables and

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.