Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Wes aoeu
RE: undefined method `Ask' [ reply ]  
2009-10-30 18:26
That worked thank you.

By: James Gray
RE: undefined method `Ask' [ reply ]  
2009-10-30 18:07
First, try:

require "highline/import"

That imports the common methods into the global namespace. Also, the method is ask(), with a small a, not Ask().

In irb, it's probably that you don't have RubyGems loaded. Try adding:

require "rubygems"

and then using:

require "highline/import"

Hope that helps.

James Edward Gray II

By: Wes aoeu
undefined method `Ask' [ reply ]  
2009-10-30 17:21
I'm attempting to use highline to mask a password and I have the following code:

require 'rubygems'
require 'highline'
pword = Ask("Enter MySQL Password: ") {|q| q.echo = "x"}

When I run the script I get

<scriptname>:6: undefined method `Ask' for main:Object (NoMethodError)

if I type require 'highline' in irb I get

irb(main):001:0> require 'highline'
LoadError: no such file to load -- highline
from (irb):1:in `require'
from (irb):1

I suspect it is not properly installed. When I run gem list it is listed as highline (1.5.1)

Windows XP SP3
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
gem is at version 1.3.4