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

  • SEARCH
  • Home
  • 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 969377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:37:52+00:00 2026-05-16T02:37:52+00:00

On my ubuntu box, irb (ruby) gives a NameError when I try to use

  • 0

On my ubuntu box, irb (ruby) gives a NameError when I try to use the mechanize gem:

$ irb
irb(main):001:0> require 'mechanize'
=> true
irb(main):002:0> Mechanize.new
NameError: uninitialized constant Mechanize
    from (irb):2
    from :0

gem env shows this:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: /usr/bin/ruby1.8
  - EXECUTABLE DIRECTORY: /usr/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/lib/ruby/gems/1.8
     - /var/lib/gems/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :gempath => ["/var/lib/gems/1.8", "/usr/lib/ruby/gems/1.8"]
  - REMOTE SOURCES:
     - http://rubygems.org/

gem list shows it’s installed:

$ gem list mech
*** LOCAL GEMS ***
mechanize (1.0.0)

it’s in both paths in the filesystem:

$ ls -1 /var/lib/gems/1.8/gems/ |grep mech
mechanize-1.0.0

$ ls -1 /usr/lib/ruby/gems/1.8/gems |grep mech
mechanize-1.0.0

RubyGems is up to date:

$ gem update --system
Updating RubyGems
Nothing to update

# gem list rubygems
*** LOCAL GEMS ***
rubygems-update (1.3.7)

I have an up-to-date ruby:

ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]

Here’s what ubuntu gems packages I have (note that I installed rubygems-update and ran update_rubygems):

# dpkg -l rubygems*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name               Version            Description
+++-==================-==================-====================================================
ii  rubygems           1.3.5-1ubuntu2     package management framework for Ruby libraries/appl
ii  rubygems-doc       1.3.5-1ubuntu2     package management framework for Ruby libraries/appl
ii  rubygems1.8        1.3.5-1ubuntu2     package management framework for Ruby libraries/appl
  • 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-16T02:37:52+00:00Added an answer on May 16, 2026 at 2:37 am

    try to create the class using

    WWW::Mechanize.new
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've set up TeamCity on a Linux (Ubuntu) box and would like to use
I've installed the Curb and Curb-fu gem and libcurl on my Ubuntu box. If
I've installed apache2 and ColdFusion 9 on an Ubuntu 12.04 box. I've already use
I would like to set apt-get to use a proxy on my ubuntu box.
I recently inherited a Ubuntu Hardy box that acts rather funky out-of-the-box. The first
Question: What command do you type in to the Run Application box on ubuntu
I am running windows 7 and have installed an Ubuntu machine using virtual box.
Ubuntu 12.04 has an open bug regarding openssl. If you try to connect to
I have a Mongo server running on an Ubuntu box, and I am trying
I 've Set up wowza streaming server in my ubuntu box for RTSP streaming

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.