![]() | Create Strong and Convenient Passwords |
|
30 Nov 2008, 20:28
Steven Finnegan (19 posts) |
When I try to run this program (convenient_password.rb) I get the following errors.
I have the ngrams gem installed. |
|
01 Dec 2008, 07:32
Maik Schmidt (110 posts) |
Hi, Steven! The ngrams gem needs the YAML library and tries to require it in line 24 of the file /Library/Ruby/Gems/1.8/gems/ngrams-0.1.0/lib/ngrams/ngrams.rb. Unfortunately, it cannot be found on your system although it’s part of the Ruby standard library (at least in version 1.8 which seems to be the version you’re using). Could you check, if you can reproduce the following irb session: $ irb Cheers, Maik |
|
01 Dec 2008, 13:00
Steven Finnegan (19 posts) |
Thanks for your help, Maik! Well, you’re right, it’s not found. For what its worth, this is running under OS X Leopard. I believe I have everything updated to current releases.
Interestingly, it DOES seem to be on the disk…
|
|
01 Dec 2008, 15:15
Maik Schmidt (110 posts) |
I guess there’s something wrong with your load path. What’s the output of the following two commands: $ ruby -e ‘puts $:’ |
|
01 Dec 2008, 15:52
Steven Finnegan (19 posts) |
I have 2 Macs (both intel)—both behave the same (though one may not be as current). Both return the following to your two commands:
|
|
02 Dec 2008, 18:25
Maik Schmidt (110 posts) |
Hi, Steven! I have setup a complete new Ruby environment in a Parallels virtual machine on Windows XP. I could not fully reproduce your problem, but found some strange behavior regarding the name of the YAML library. Please replace Cheers, Maik |
|
02 Dec 2008, 21:21
Steven Finnegan (19 posts) |
YES! That worked! Thanks for all your help! sjf |
|
03 Feb 2009, 14:08
Matteo Panara (1 post) |
Maybe there is a better solution. Create YAML.rb in your app lib path with this line: require ‘yaml’ Bye! |
|
26 Sep 2009, 14:22
jonathan belolo (3 posts) |
Hi, as mentioned in the errata, the method enable_post_connection_check seems to be deprecated… which could explain why I get this error : random_org_password.rb:27:in `send_request’: undefined method `enable_post_connection_check’ for # (NoMethodError) which method should we call instead ? thanks |
|
16 Oct 2009, 05:59
Maik Schmidt (110 posts) |
The enable_post_connection_check method has been removed, because the check is performed by default now. You can turn it off by setting Net::HTTP#verify_mode= OpenSSL::SSL::VERIFY_NONE. To make your code portable use the following statement: https.enable_post_connection_check = true if https.respond_to? :enable_post_connection_check Cheers Maik |
| You must be logged in to comment |

