Mechanize failure

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

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

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?

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

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

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:inrequire’
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:ineach’
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:inexecute’
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:inprocess_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:inrun’
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

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).

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…