Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > LoadError - Mechanize, Hpricot (gems)

Reply
Thread Tools

LoadError - Mechanize, Hpricot (gems)

 
 
killy971@gmail.com
Guest
Posts: n/a
 
      08-15-2007
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/mecha...MPLES_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 ?

 
Reply With Quote
 
 
 
 
Alex Young
Guest
Posts: n/a
 
      08-15-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) 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

 
Reply With Quote
 
 
 
 
killy971
Guest
Posts: n/a
 
      08-15-2007
> 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>

 
Reply With Quote
 
Stefan Mahlitz
Guest
Posts: n/a
 
      08-15-2007
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


 
Reply With Quote
 
killy971
Guest
Posts: n/a
 
      08-15-2007
On 8 16 , 7:28, Stefan Mahlitz <(E-Mail Removed)> 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 ?

 
Reply With Quote
 
killy971
Guest
Posts: n/a
 
      08-15-2007
On 8 16 , 7:28, Stefan Mahlitz <(E-Mail Removed)> 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.

 
Reply With Quote
 
Stefan Mahlitz
Guest
Posts: n/a
 
      08-16-2007
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/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with fresh install of RubyGems on Ubuntu Linux: No suchfile to load -- rubygems/builder (LoadError) Trevor Ruby 5 01-29-2005 12:52 AM
mod_ruby require LoadError Richard Turner Ruby 1 01-26-2005 11:13 AM
LoadError while installing RubyGems 0.8.4 Thursday Ruby 1 01-10-2005 06:37 AM
Getting error: ..."in 'require': No such file to load -- socket (LoadError) Ruby Ruby Ruby 0 04-22-2004 12:34 PM
finding ruby.h / problem with rbconfig (LoadError) Oliver Obst Ruby 4 09-29-2003 08:54 AM



Advertisments