LoadError - Mechanize, Hpricot (gems)

Discussion in 'Ruby' started by killy971@gmail.com, Aug 15, 2007.

  1. Guest

    Hello,

    I've been trying to install and use Mechanize ( http://rubyforge.org/projects/mechanize/
    ), and cannot solve the errors that occur.

    Actually, I'm not sure the error is really linked to this gem, because
    I remember having had the same kind of problems while trying to
    install other gems.

    So, I'm working on windows, with cygwin.

    I installed Mechanize with the following command line :

    > gem install mechanize


    and it seems to have installed successfully :

    Successfully installed mechanize-0.6.10
    Installing ri documentation for mechanize-0.6.10...
    Installing RDoc documentation for mechanize-0.6.10...

    So, after this, I try to use it, as written on this page :

    http://mechanize.rubyforge.org/mechanize/files/EXAMPLES_txt.html

    And here's what happens :

    irb(main):001:0> require "rubygems"
    => true
    irb(main):002:0> require "mechanize"
    LoadError: Permission denied - /usr/lib/ruby/gems/1.8/gems/hpricot-0.6-
    mswin32/lib/i686-linux/hpricot_scan.so
    from /usr/lib/ruby/gems/1.8/gems/hpricot-0.6-mswin32/lib/i686-
    linux/hpricot_scan.so
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `require'
    from /usr/lib/ruby/gems/1.8/gems/hpricot-0.6-mswin32/lib/
    hpricot.rb:20
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `require'
    from /usr/lib/ruby/gems/1.8/gems/mechanize-0.6.10/lib/
    mechanize/page.rb:2
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `require'
    from /usr/lib/ruby/gems/1.8/gems/mechanize-0.6.10/lib/
    mechanize.rb:40
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `require'
    from (irb):2
    from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:279

    Then, I just go where the hpricot_scan.so file is, "chmod +x" it, and
    retry. Then :

    irb(main):003:0> require "mechanize"
    LoadError: No such file or directory - /usr/lib/ruby/gems/1.8/gems/
    hpricot-0.6-mswin32/lib/i686-linux/hpricot_scan.so
    from /usr/lib/ruby/gems/1.8/gems/hpricot-0.6-mswin32/lib/i686-
    linux/hpricot_scan.so
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `require'
    from /usr/lib/ruby/gems/1.8/gems/hpricot-0.6-mswin32/lib/
    hpricot.rb:20
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `require'
    from /usr/lib/ruby/gems/1.8/gems/mechanize-0.6.10/lib/
    mechanize/page.rb:2
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `require'
    from /usr/lib/ruby/gems/1.8/gems/mechanize-0.6.10/lib/
    mechanize.rb:40
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `require'
    from (irb):3
    from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:279

    Anyway, the file really does exists.

    Is there anyone who know how to solve this problem please ?
     
    , Aug 15, 2007
    #1
    1. Advertising

  2. Alex Young Guest

    wrote:
    <snip>
    > irb(main):001:0> require "rubygems"
    > => true
    > irb(main):002:0> require "mechanize"
    > LoadError: Permission denied - /usr/lib/ruby/gems/1.8/gems/hpricot-0.6-
    > mswin32/lib/i686-linux/hpricot_scan.so

    <snip>
    Is Hpricot installed?

    --
    Alex
     
    Alex Young, Aug 15, 2007
    #2
    1. Advertising

  3. killy971 Guest

    > Is Hpricot installed?

    Yes it is.

    Another attempt, on another machine :

    [Guillaume@KILLY971 ~]$ gem install mechanize
    Bulk updating Gem source index for: http://gems.rubyforge.org
    Install required dependency hpricot? [Yn] Y
    Select which gem to install for your platform (i386-cygwin)
    1. hpricot 0.6 (mswin32)
    2. hpricot 0.6 (jruby)
    3. hpricot 0.6 (ruby)
    4. hpricot 0.5 (ruby)
    5. hpricot 0.5 (mswin32)
    6. Skip this gem
    7. Cancel installation
    > 1

    Install required dependency hoe? [Yn] Y
    Install required dependency rubyforge? [Yn] Y
    Successfully installed mechanize-0.6.10
    Successfully installed hpricot-0.6-mswin32
    Successfully installed hoe-1.3.0
    Successfully installed rubyforge-0.4.4
    Installing ri documentation for mechanize-0.6.10...
    Installing ri documentation for hpricot-0.6-mswin32...
    Installing ri documentation for hoe-1.3.0...
    Installing ri documentation for rubyforge-0.4.4...
    Installing RDoc documentation for mechanize-0.6.10...
    Installing RDoc documentation for hpricot-0.6-mswin32...
    Installing RDoc documentation for hoe-1.3.0...
    Installing RDoc documentation for rubyforge-0.4.4...
    [Guillaume@KILLY971 ~]$ irb
    irb(main):001:0> require "rubygems"
    => true
    irb(main):002:0> require "mechanize"
    LoadError: Permission denied - /usr/lib/ruby/gems/1.8/gems/hpricot-0.6-
    mswin32/lib/i686-linux/hpricot_scan.so
    from /usr/lib/ruby/gems/1.8/gems/hpricot-0.6-mswin32/lib/i686-
    linux/hpricot_scan.so
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `require'
    from /usr/lib/ruby/gems/1.8/gems/hpricot-0.6-mswin32/lib/
    hpricot.rb:20
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `require'
    from /usr/lib/ruby/gems/1.8/gems/mechanize-0.6.10/lib/
    mechanize/page.rb:2
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `require'
    from /usr/lib/ruby/gems/1.8/gems/mechanize-0.6.10/lib/
    mechanize.rb:40
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `gem_original_require'
    from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
    32:in `require'
    from (irb):2
    irb(main):003:0>
     
    killy971, Aug 15, 2007
    #3
  4. killy971 wrote:
    >> Is Hpricot installed?

    >
    > Yes it is.
    >
    > Another attempt, on another machine :
    >
    > [Guillaume@KILLY971 ~]$ gem install mechanize
    > Bulk updating Gem source index for: http://gems.rubyforge.org
    > Install required dependency hpricot? [Yn] Y
    > Select which gem to install for your platform (i386-cygwin)
    > 1. hpricot 0.6 (mswin32)
    > 2. hpricot 0.6 (jruby)
    > 3. hpricot 0.6 (ruby)
    > 4. hpricot 0.5 (ruby)
    > 5. hpricot 0.5 (mswin32)
    > 6. Skip this gem
    > 7. Cancel installation
    >> 1


    Shouldn't you use ruby (3) for a cygwin install?

    Stefan
     
    Stefan Mahlitz, Aug 15, 2007
    #4
  5. killy971 Guest

    On 8 16 , 7:28, Stefan Mahlitz <> wrote:
    > killy971 wrote:
    > >> Is Hpricot installed?

    >
    > > Yes it is.

    >
    > > Another attempt, on another machine :

    >
    > > [Guillaume@KILLY971 ~]$ gem install mechanize
    > > Bulk updating Gem source index for:http://gems.rubyforge.org
    > > Install required dependency hpricot? [Yn] Y
    > > Select which gem to install for your platform (i386-cygwin)
    > > 1. hpricot 0.6 (mswin32)
    > > 2. hpricot 0.6 (jruby)
    > > 3. hpricot 0.6 (ruby)
    > > 4. hpricot 0.5 (ruby)
    > > 5. hpricot 0.5 (mswin32)
    > > 6. Skip this gem
    > > 7. Cancel installation
    > >> 1

    >
    > Shouldn't you use ruby (3) for a cygwin install?
    >
    > Stefan


    I didn't know, until know it seemed to work when I was using mswin32
    to install other gems...
    I am going to try. By the way, what is the difference between these 2
    installs ?
     
    killy971, Aug 16, 2007
    #5
  6. killy971 Guest

    On 8 16 , 7:28, Stefan Mahlitz <> wrote:
    > killy971 wrote:
    > >> Is Hpricot installed?

    >
    > > Yes it is.

    >
    > > Another attempt, on another machine :

    >
    > > [Guillaume@KILLY971 ~]$ gem install mechanize
    > > Bulk updating Gem source index for:http://gems.rubyforge.org
    > > Install required dependency hpricot? [Yn] Y
    > > Select which gem to install for your platform (i386-cygwin)
    > > 1. hpricot 0.6 (mswin32)
    > > 2. hpricot 0.6 (jruby)
    > > 3. hpricot 0.6 (ruby)
    > > 4. hpricot 0.5 (ruby)
    > > 5. hpricot 0.5 (mswin32)
    > > 6. Skip this gem
    > > 7. Cancel installation
    > >> 1

    >
    > Shouldn't you use ruby (3) for a cygwin install?
    >
    > Stefan


    Thank you very much !
    I tryed to install like you said, with the 3 option, and now it works
    perfectly.
     
    killy971, Aug 16, 2007
    #6
  7. killy971 wrote:
    >>> [Guillaume@KILLY971 ~]$ gem install mechanize
    >>> Bulk updating Gem source index for:http://gems.rubyforge.org
    >>> Install required dependency hpricot? [Yn] Y
    >>> Select which gem to install for your platform (i386-cygwin)
    >>> 1. hpricot 0.6 (mswin32)
    >>> 2. hpricot 0.6 (jruby)
    >>> 3. hpricot 0.6 (ruby)
    >>> 4. hpricot 0.5 (ruby)
    >>> 5. hpricot 0.5 (mswin32)
    >>> 6. Skip this gem
    >>> 7. Cancel installation
    >>>> 1

    >> Shouldn't you use ruby (3) for a cygwin install?

    >
    > I didn't know, until know it seemed to work when I was using mswin32
    > to install other gems...
    > I am going to try. By the way, what is the difference between these 2
    > installs ?


    I'm not 100% sure about the facts or the wording, so take this with a
    grain of salt:

    Cygwin provides an environment where posix-compliant programs can
    compile and run. This means that any library used by this program must
    be compiled for cygwin as well.

    Windows users (at least those I know) do not have a compiler installed
    so most gem-authors provide a gem with compiled libraries that fit to a
    windows-ruby.

    If you select the mswin32-gem the precompiled libraries get installed,
    which are not compatible to cygwin.

    So, if on cygwin - always select ruby-versions of gem.

    Some time ago I had problems with a parallel install of a windows-ruby
    (via one-click-installer) and the cygwin one - something to do with
    environment variables. So be careful when mixing.

    Stefan

    P.S.: There was a poll (via gem) some time ago about which platforms
    ruby is used on - http://tattle.rubygarden.org/
     
    Stefan Mahlitz, Aug 16, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Szinek
    Replies:
    2
    Views:
    161
    Peter Szinek
    Feb 21, 2007
  2. Ehud Rosenberg
    Replies:
    2
    Views:
    145
    Ehud Rosenberg
    Nov 14, 2007
  3. Cy Gar
    Replies:
    6
    Views:
    228
    Cy Gar
    May 19, 2008
  4. Just Another Victim of the Ambient Morality

    How can one get the Hpricot DOM document from Mechanize?

    Just Another Victim of the Ambient Morality, Sep 13, 2008, in forum: Ruby
    Replies:
    3
    Views:
    112
    Aaron Patterson
    Sep 18, 2008
  5. Augusto Esteves

    Gems LoadError in Linux

    Augusto Esteves, Dec 23, 2009, in forum: Ruby
    Replies:
    8
    Views:
    162
    Sam Weber
    Sep 7, 2010
Loading...

Share This Page