[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

mac - hpricot problems

Sergio Ruiz

9/27/2007 10:28:00 PM

i am trying to get hpricot running (so i can run mechanize) and am
running into problems..

i have installed hpricot a few times (just deleted it from the gems) and
did a fresh 'gem install hpricot'..

the problem i have is..

every time i try to run it, i get:


irb(main):003:0> require 'hpricot'
LoadError: no such file to load -- hpricot
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
`gem_original_require'
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
`require'
from (irb):3


anyone have any ideas?

thanks!
--
Posted via http://www.ruby-....

24 Answers

Daniel Waite

9/28/2007

0

Sergio Ruiz wrote:
> i am trying to get hpricot running (so i can run mechanize) and am
> running into problems..
>
> i have installed hpricot a few times (just deleted it from the gems) and
> did a fresh 'gem install hpricot'..
>
> the problem i have is..
>
> every time i try to run it, i get:
>
>
> irb(main):003:0> require 'hpricot'
> LoadError: no such file to load -- hpricot
> from
> /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
> `gem_original_require'
> from
> /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
> `require'
> from (irb):3
>
>
> anyone have any ideas?

I'm going from memory, but I believe you have to require rubygems first.
Example:

require 'rubygems'
require 'hpricot'

Hpricot.XML(some_feed)
--
Posted via http://www.ruby-....

Sergio Ruiz

9/28/2007 12:06:00 AM

0


> require 'rubygems'
> require 'hpricot'
>
> Hpricot.XML(some_feed)

i forgot to mention that at first.. yes..

i did require 'rubygems'..

here's another snapshot..



irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'hpricot'
LoadError: no such file to load -- hpricot
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
`gem_original_require'
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
`require'
from (irb):2
irb(main):003:0>
irb(main):004:0*


thanks!
--
Posted via http://www.ruby-....

Ryan Davis

9/28/2007 1:04:00 AM

0


On Sep 27, 2007, at 17:06 , Sergio Ruiz wrote:

> irb(main):001:0> require 'rubygems'
> => true
> irb(main):002:0> require 'hpricot'
> LoadError: no such file to load -- hpricot

% find `gem env gemdir`/gems/hpricot-* -name \*.bundle -ls
13756612 240 -rw-r--r-- 1 root ryan 120824 Jul 11
10:20 /usr/local/lib/ruby/gems/1.8/gems/hpricot-0.6/ext/hpricot_scan/
hpricot_scan.bundle
13756606 240 -rwxr-xr-x 1 root ryan 120824 Jul 11
10:20 /usr/local/lib/ruby/gems/1.8/gems/hpricot-0.6/lib/i686-linux/
hpricot_scan.bundle

(no idea why one is under i686-linux... but you should definitely see
an hpricot_scan.bundle if you installed correctly.

If it is missing, what is the output from: http://www.zens...
~ryand/wtf.rb ?
what is the output of 'yes | sudo gem uninstall hpricot; yes 3 | sudo
gem install hpricot' ?

mortee

9/28/2007 2:19:00 AM

0

John Joyce

9/28/2007 2:21:00 AM

0

Try
require 'Hpricot'



Phrogz

9/28/2007 4:57:00 AM

0

On Sep 27, 8:18 pm, mortee <mortee.li...@kavemalna.hu> wrote:
> I just ran into the same trouble with Hpricot on OS X too. I can install
> any version using gem install, but I get errors when trying to use the lib.

FWIW, no trouble here. Hand-compiled ruby 1.8.6, using rubygems 0.9.4.


Slim2:~ phrogz$ sudo gem install hpricot
Password:
Bulk updating Gem source index for: http://gems.rub...
Select which gem to install for your platform (i686-darwin8.9.1)
1. hpricot 0.6 (mswin32)
2. hpricot 0.6 (jruby)
3. hpricot 0.6 (ruby)
4. hpricot 0.5.140 (mswin32)
5. hpricot 0.5.140 (jruby)
6. hpricot 0.5.140 (ruby)
7. Skip this gem
8. Cancel installation
> 3
Building native extensions. This could take a while...
Successfully installed hpricot-0.6
Installing ri documentation for hpricot-0.6...
Installing RDoc documentation for hpricot-0.6...

Slim2:~ phrogz$ irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'hpricot'
=> true
irb(main):003:0> Hpricot
=> Hpricot

mortee

9/28/2007 8:07:00 AM

0

Sergio Ruiz

9/28/2007 2:23:00 PM

0


> % find `gem env gemdir`/gems/hpricot-* -name \*.bundle -ls

hmmm..

i get ..

sergio-powerbook-g4-12:~ sergio$ find `gem env gemdir`/gems/hpricot-*
-name \*.bundle -ls
1185120 184 -rwxr-xr-x 1 root wheel 92580 Sep 27 18:23
/usr/local/lib/ruby/gems/1.8/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.bundle
1185122 184 -rwxr-xr-x 1 root wheel 92580 Sep 27 18:23
/usr/local/lib/ruby/gems/1.8/gems/hpricot-0.6/lib/i686-linux/hpricot_scan.bundle

checking everything else next..
--
Posted via http://www.ruby-....

_why

9/28/2007 3:31:00 PM

0

On Fri, Sep 28, 2007 at 11:23:27PM +0900, Sergio Ruiz wrote:
> i get ..
>
> sergio-powerbook-g4-12:~ sergio$ find `gem env gemdir`/gems/hpricot-*
> -name \*.bundle -ls
> 1185120 184 -rwxr-xr-x 1 root wheel 92580 Sep 27 18:23
> /usr/local/lib/ruby/gems/1.8/gems/hpricot-0.6/ext/hpricot_scan/hpricot_scan.bundle
> 1185122 184 -rwxr-xr-x 1 root wheel 92580 Sep 27 18:23
> /usr/local/lib/ruby/gems/1.8/gems/hpricot-0.6/lib/i686-linux/hpricot_scan.bundle
>
> checking everything else next..

Say, would you mind sending me your mkmf.log from that first directory,
Sergio? It should be right in `ext/hpricot_scan/` and it would also
be nice to see the output of `ruby -rrbconfig -e "p Config::CONFIG"` as
well.

Maybe try a plain setup.rb installer for Hpricot?

http://code.whytheluckystiff.net/dist/hpric...

_why

Sergio Ruiz

9/28/2007 6:50:00 PM

0


>
> Say, would you mind sending me your mkmf.log from that first directory,
> Sergio? It should be right in `ext/hpricot_scan/` and it would also
> be nice to see the output of `ruby -rrbconfig -e "p Config::CONFIG"` as
> well.
>

here you go:

have_library: checking for main() in -lc... -------------------- yes

"gcc -o conftest -I. -I/usr/local/lib/ruby/1.8/powerpc-darwin8.10.0 -I.
-g -O2 -fno-common -pipe -fno-common conftest.c -L"/usr/local/lib"
-lruby-static -lc -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: /*top*/
2: int main() { return 0; }
3: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
/* end */

--------------------




this is really messy..

ruby -rrbconfig -e "p
Config::CONFIG"{"sitedir"=>"/usr/local/lib/ruby/site_ruby",
"MAKEFILES"=>"Makefile", "LIBRUBY"=>"libruby.1.8.6.dylib",
"MAKEDIRS"=>"mkdir -p", "PACKAGE_VERSION"=>"", "GREP"=>"/usr/bin/grep",
"prefix"=>"/usr/local", "COMMON_LIBS"=>"",
"rubylibdir"=>"/usr/local/lib/ruby/1.8",
"target"=>"powerpc-apple-darwin8.10.0", "DLLWRAP"=>"", "AR"=>"ar",
"target_alias"=>"", "MANTYPE"=>"doc",
"docdir"=>"/usr/local/share/doc/$(PACKAGE)", "RDOCTARGET"=>"",
"dvidir"=>"/usr/local/share/doc/$(PACKAGE)", "AS"=>"as", "GNU_LD"=>"no",
"MAINLIBS"=>"", "WINDRES"=>"", "XCFLAGS"=>" -DRUBY_EXPORT",
"datarootdir"=>"/usr/local/share", "RUBY_INSTALL_NAME"=>"ruby",
"LN_S"=>"ln -s",
"archdir"=>"/usr/local/lib/ruby/1.8/powerpc-darwin8.10.0",
"LINK_SO"=>"", "MINIRUBY"=>"./miniruby", "DLDLIBS"=>"", "EXEEXT"=>"",
"target_vendor"=>"apple", "RUNRUBY"=>"./miniruby $(srcdir)/runruby.rb
--extout=.ext --", "DESTDIR"=>"", "sbindir"=>"/usr/local/sbin",
"LIBPATHENV"=>"DYLD_LIBRARY_PATH", "sitearch"=>"powerpc-darwin8.10.0",
"psdir"=>"/usr/local/share/doc/$(PACKAGE)", "host_cpu"=>"powerpc",
"DLEXT2"=>"", "LIBS"=>"-lpthread -ldl -lobjc ",
"localedir"=>"/usr/local/share/locale", "rubyw_install_name"=>"",
"EXTOUT"=>".ext", "ECHO_C"=>"", "OBJDUMP"=>"",
"arch"=>"powerpc-darwin8.10.0", "MAJOR"=>"1", "ruby_version"=>"1.8",
"CC"=>"gcc", "EGREP"=>"/usr/bin/grep -E", "COMMON_HEADERS"=>"",
"COMMON_MACROS"=>"", "PACKAGE_TARNAME"=>"", "build_cpu"=>"powerpc",
"build_vendor"=>"apple", "host_alias"=>"", "RANLIB"=>"ranlib",
"LDSHARED"=>"cc -dynamic -bundle -undefined suppress -flat_namespace",
"LIBRUBYARG_SHARED"=>"-lruby", "YFLAGS"=>"",
"htmldir"=>"/usr/local/share/doc/$(PACKAGE)", "MINOR"=>"8",
"INSTALL_SCRIPT"=>"/usr/bin/install -c", "EXPORT_PREFIX"=>"",
"LIBRUBY_ALIASES"=>"libruby.1.8.dylib libruby.dylib", "LDFLAGS"=>"",
"datadir"=>"/usr/local/share", "NM"=>"",
"includedir"=>"/usr/local/include", "infodir"=>"/usr/local/share/info",
"host_os"=>"darwin8.10.0", "build"=>"powerpc-apple-darwin8.10.0",
"host"=>"powerpc-apple-darwin8.10.0", "INSTALL_DATA"=>"/usr/bin/install
-c -m 644", "build_os"=>"darwin8.10.0", "DLDFLAGS"=>"",
"ruby_install_name"=>"ruby", "DLEXT"=>"bundle",
"LIBRUBY_SO"=>"libruby.1.8.6.dylib", "TEENY"=>"6", "CPP"=>"gcc -E",
"ALLOCA"=>"$(LIBOBJDIR)alloca.o", "sysconfdir"=>"/usr/local/etc",
"exec_prefix"=>"/usr/local", "PATH_SEPARATOR"=>":", "LIBEXT"=>"a",
"mandir"=>"/usr/local/share/man", "libdir"=>"/usr/local/lib",
"build_alias"=>"", "target_cpu"=>"powerpc", "ECHO_N"=>"-n",
"sharedstatedir"=>"/usr/local/com", "YACC"=>"bison -y",
"configure_args"=>" '--prefix=/usr/local' '--enable-pthread'
'--with-readline-dir=/usr/local' '--enable-shared'", "SOLIBS"=>"",
"host_vendor"=>"apple", "TRY_LINK"=>"", "PACKAGE_STRING"=>"",
"target_os"=>"darwin8.10.0", "oldincludedir"=>"/usr/include",
"CP"=>"cp", "SET_MAKE"=>"", "LIBRUBYARG_STATIC"=>"-lruby-static",
"LIBRUBYARG"=>"-lruby", "RUBYW_INSTALL_NAME"=>"", "PACKAGE_NAME"=>"",
"pdfdir"=>"/usr/local/share/doc/$(PACKAGE)", "EXTSTATIC"=>"",
"ECHO_T"=>"", "RPATHFLAG"=>"", "SHELL"=>"/bin/sh", "STATIC"=>"",
"ASFLAGS"=>"", "INSTALL"=>"/usr/bin/install -c",
"sitearchdir"=>"/usr/local/lib/ruby/site_ruby/1.8/powerpc-darwin8.10.0",
"STRIP"=>"strip -A -n", "ARCHFILE"=>"",
"LIBRUBY_DLDFLAGS"=>"-install_name /usr/local/lib/libruby.dylib
-current_version 1.8.6 -compatibility_version 1.8", "OBJEXT"=>"o",
"XLDFLAGS"=>" -L.", "LIBRUBY_LDSHARED"=>"cc -dynamiclib -undefined
suppress -flat_namespace", "ENABLE_SHARED"=>"yes", "RM"=>"rm -f",
"CCDLFLAGS"=>" -fno-common", "setup"=>"Setup", "CPPOUTFILE"=>"-o
conftest.i", "topdir"=>"/usr/local/lib/ruby/1.8/powerpc-darwin8.10.0",
"RUBY_SO_NAME"=>"ruby", "CFLAGS"=>"-g -O2 -fno-common -pipe
-fno-common", "localstatedir"=>"/usr/local/var", "LIBPATHFLAG"=>"
-L\"%s\"", "bindir"=>"/usr/local/bin",
"sitelibdir"=>"/usr/local/lib/ruby/site_ruby/1.8",
"NROFF"=>"/usr/bin/nroff", "CPPFLAGS"=>"",
"INSTALL_PROGRAM"=>"/usr/bin/install -c", "PACKAGE_BUGREPORT"=>"",
"libexecdir"=>"/usr/local/libexec", "OUTFLAG"=>"-o ",
"LIBRUBY_A"=>"libruby-static.a", "PREP"=>"miniruby", "ARCH_FLAG"=>""}\

> Maybe try a plain setup.rb installer for Hpricot?
>

trying this next..
--
Posted via http://www.ruby-....