# Mechanize failure

**URL:** <https://www.ruby-forum.com/t/mechanize-failure/86329>\
**Category:** Ruby\
**Created:** [February 21, 2007, 2:42pm UTC](https://www.ruby-forum.com/t/mechanize-failure/86329 "2007-02-21T14:42:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![regularfry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Post date:** [February 21, 2007, 2:42pm UTC](https://www.ruby-forum.com/t/mechanize-failure/86329/1 "2007-02-21T14:42:39Z")

</div>

Hi all,

Does anybody recognise this?

$ gem check -t mechanize  
ERROR: While executing gem … (NameError)  
method `use\_ssl?’ not defined in Net::HTTP

This is on a Debian system, so I’ve probably forgotten an apt-get  
install somewhere, but I can’t spot which one:

$ dpkg -l | grep ruby  
ii libmysql-ruby1 2.4.5-6.1 MySQL module for Ruby 1.8  
ii libopenssl-rub 1.0.0+ruby1.8. OpenSSL interface for Ruby  
ii libruby1.8 1.8.2-7sarge5 Libraries necessary to run Ruby 1.8  
ii rdoc 1.8.2-1 Generate documentation from ruby  
source file  
ii ruby 1.8.2-1 An interpreter of object-oriented  
scripting  
ii ruby1.8 1.8.2-7sarge5 Interpreter of object-oriented  
scripting lan  
ii ruby1.8-dev 1.8.2-7sarge5 Header files for compiling extension  
modules

---

<div class="post-metadata">

**Author:** ![regularfry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Post date:** [February 21, 2007, 2:48pm UTC](https://www.ruby-forum.com/t/mechanize-failure/86329/2 "2007-02-21T14:48:40Z")

</div>

On Wed, Feb 21, 2007 at 10:41:17PM +0900, Alex Y. wrote:

> $ dpkg -l | grep ruby  
> ii libmysql-ruby1 2.4.5-6.1 MySQL module for Ruby 1.8  
> ii libopenssl-rub 1.0.0+ruby1.8. OpenSSL interface for Ruby  
> […]

You’re cut off there for some reason, but you should make sure you have  
libopenssl-ruby1.8 installed, not just libopenssl-ruby.

> Alex  
> –Greg

---

<div class="post-metadata">

**Author:** ![regularfry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Post date:** [February 21, 2007, 2:54pm UTC](https://www.ruby-forum.com/t/mechanize-failure/86329/3 "2007-02-21T14:54:40Z")

</div>

Gregory S. wrote:

> > This is on a Debian system, so I’ve probably forgotten an apt-get

Ah. Thanks. Any idea what the difference between the two is, and when  
you’d want one rather than the other?

---

<div class="post-metadata">

**Author:** ![regularfry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Post date:** [February 21, 2007, 2:57pm UTC](https://www.ruby-forum.com/t/mechanize-failure/86329/4 "2007-02-21T14:57:40Z")

</div>

Gregory S. wrote:

> > This is on a Debian system, so I’ve probably forgotten an apt-get

That doesn’t seem to be the issue:

$ sudo apt-get install libopenssl-ruby1.8 libopenssl-ruby  
Reading Package Lists… Done  
Building Dependency Tree… Done  
libopenssl-ruby1.8 is already the newest version.  
libopenssl-ruby is already the newest version.  
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.  
$ sudo gem check -t mechanize  
ERROR: While executing gem … (NameError)  
method `use\_ssl?’ not defined in Net::HTTP

---

<div class="post-metadata">

**Author:** ![regularfry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Post date:** [February 21, 2007, 2:59pm UTC](https://www.ruby-forum.com/t/mechanize-failure/86329/5 "2007-02-21T14:59:40Z")

</div>

On Wed, Feb 21, 2007 at 10:54:01PM +0900, Alex Y. wrote:

> > > 
> > 
> > libopenssl-ruby1.8 installed, not just libopenssl-ruby.
> 
> Ah. Thanks. Any idea what the difference between the two is, and when  
> you’d want one rather than the other?

Compare:

apt-cache policy libopenssl-ruby  
apt-cache policy libopenssl-ruby1.8

It looks like libopenssl-ruby is targeted at ruby 1.8.2.

> Alex  
> –Greg

---

<div class="post-metadata">

**Author:** ![regularfry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Post date:** [February 21, 2007, 3:09pm UTC](https://www.ruby-forum.com/t/mechanize-failure/86329/6 "2007-02-21T15:09:42Z")

</div>

On Wed, Feb 21, 2007 at 10:57:04PM +0900, Alex Y. wrote:

> > > 
> > 
> > libopenssl-ruby1.8 installed, not just libopenssl-ruby.  
> > ERROR: While executing gem … (NameError)  
> > method `use\_ssl?’ not defined in Net::HTTP

Well, it was a thought. Trying it on my Debian box, I find that I can  
install mechanize and it seems to work okay, but sudo gem check -t  
mechanize produces:

./test/test\_includes.rb:5: warning: already initialized constant  
BASE\_DIR  
./test/test\_includes.rb:32: warning: already initialized constant  
SERVLETS  
./test/test\_includes.rb:35: warning: already initialized constant  
PAGE\_CACHE  
./test/test\_includes.rb:110: warning: already initialized constant PORT  
./test/test\_includes.rb:111: warning: already initialized constant  
PROXYPORT  
./test/test\_includes.rb:112: warning: already initialized constant  
SSLPORT  
/usr/local/lib/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require': no such file to load -- test/htdocs/alt_text.html (LoadError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in`require’  
from /usr/local/lib/site\_ruby/1.8/rubygems/validator.rb:134:in  
`unit_test' from /usr/local/lib/site_ruby/1.8/rubygems/validator.rb:134:in`each’  
from /usr/local/lib/site\_ruby/1.8/rubygems/validator.rb:134:in  
`unit_test' from /usr/local/lib/site_ruby/1.8/rubygems/gem_commands.rb:680:in`execute’  
from /usr/local/lib/site\_ruby/1.8/rubygems/command.rb:70:in  
`invoke' from /usr/local/lib/site_ruby/1.8/rubygems/cmd_manager.rb:120:in`process\_args’  
from /usr/local/lib/site\_ruby/1.8/rubygems/cmd\_manager.rb:91:in  
`run' from /usr/local/lib/site_ruby/1.8/rubygems/gem_runner.rb:30:in`run’  
from /usr/local/bin/gem:17

…so at least I get a different error. It’s possible that there is some  
assumption about where I have RubyGems installed (/usr/local) that’s  
causing a problem. Here’s my system:

% dpkg -l ‘_ruby_’ | grep ii  
ii libopenssl-ruby 1.0.0+ruby1.8.2-1 OpenSSL interface for Ruby  
ii libopenssl-ruby1.8 1.8.5-3 OpenSSL interface for Ruby  
1.8  
ii libreadline-ruby1.8 1.8.5-3 Readline interface for  
Ruby 1.8  
ii librmagick-ruby 1.13.0-1 ImageMagick API for Ruby  
ii librmagick-ruby1.8 1.13.0-1 ImageMagick API for Ruby  
ii libruby1.8 1.8.5-3 Libraries necessary to run  
Ruby 1.8  
ii postgresql-8.1-plruby 0.5.0-1 Ruby procedural language  
for PostgreSQL  
ii ruby 1.8.2-1 An interpreter of  
object-oriented scripting  
ii ruby1.8 1.8.5-3 Interpreter of  
object-oriented scripting lan  
ii ruby1.8-dev 1.8.5-3 Header files for compiling  
extension modules

> Alex  
> –Greg

---

<div class="post-metadata">

**Author:** ![regularfry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Post date:** [February 21, 2007, 4:10pm UTC](https://www.ruby-forum.com/t/mechanize-failure/86329/7 "2007-02-21T16:10:50Z")

</div>

On Wed, 21 Feb 2007 22:58:08 +0900, Gregory S. wrote:

> > > > method `use\_ssl?’ not defined in Net::HTTP  
> > > > You’re cut off there for some reason, but you should make sure you have  
> > > > It looks like libopenssl-ruby is targeted at ruby 1.8.2.  
> > > > Wrong!

libopenssl-ruby is simply a dummy package designed to install the  
appropriate version of the package for the appropriate version of the  
interpreter. By installing ruby, you get ruby 1.8 pulled in as a  
dependancy  
(as opposed to ruby 1.9). Likewise, by installing libopenssl-ruby, you  
get  
libopenssl-ruby1.8 as opposed to 1.9. One day when 2.0 becomes the new  
stable, you’ll be upgraded to ruby2.0 and libopenssl-ruby2.0  
automatically  
because they’ll be the new dependancies for the dummy package.

Package: libopenssl-ruby  
[snip part of the description]  
Description: OpenSSL interface for Ruby  
This package makes Ruby to be able to use OpenSSL. It includes HTTP and  
TELNET protocols’ SSL/TLS support.  
.  
This package is a dependency package, which depends on Debian’s default  
Ruby version (currently 1.8.x).

---

<div class="post-metadata">

**Author:** ![regularfry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Post date:** [February 21, 2007, 3:43pm UTC](https://www.ruby-forum.com/t/mechanize-failure/86329/8 "2007-02-21T15:43:45Z")

</div>

Gregory S. wrote:

> > > > method `use\_ssl?’ not defined in Net::HTTP  
> > > > You’re cut off there for some reason, but you should make sure you have  
> > > > It looks like libopenssl-ruby is targeted at ruby 1.8.2.  
> > > > Just for information, debian packages work this way: for each ruby  
> > > > thing packaged for debian, there are (at least) two packages a  
> > > > lib…-ruby and a lib…ruby1.8. The former is empty and depends on the  
> > > > latter and is there to make the transition to newer versions of ruby  
> > > > more easy (for the maintainers). packagers can also choose to provide a  
> > > > -ruby1.9 version. (this is not true for all packages, but for the  
> > > > greatest majority).

Vince, waiting to get upload rights to the debian archive…
