Rubygems fail - require hpricot!

Hi guys,
I wanted to fetch some info from webpage and use it in my db. I read
hpricot is one way to do it. But the problem is I’m unable to use it
with my app. For some reason after successfully installing hpricot it
fails when I try to use it in the rails console.

I’ve been trying to fix this for the last four-five days. I’m stumped !
I tried re-installing everything and still cant go past the error. Can
some one please help me, I really appreciate it !

I have put down all the info below, I’m running mac os - snow leopard. I
see the same problem on centOS 5.5 too :frowning:

lenovo-t400:gems Anush$ gem install hpricot
Fetching: hpricot-0.8.4.gem (100%)
Building native extensions. This could take a while…
Successfully installed hpricot-0.8.4
1 gem installed
Installing ri documentation for hpricot-0.8.4…
Installing RDoc documentation for hpricot-0.8.4…
lenovo-t400:gems Anush$

Loading development environment (Rails 3.0.5)
ruby-1.9.2-p180 :001 > require ‘rubygems’
=> nil
ruby-1.9.2-p180 :002 > require ‘hpricot’
LoadError: no such file to load – hpricot
from
/Users/Anush/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in
require' from /Users/Anush/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in block in require’
from
/Users/Anush/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in
block in load_dependency' from /Users/Anush/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in new_constants_in’
from
/Users/Anush/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in
load_dependency' from /Users/Anush/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in require’
from (irb):2
from
/Users/Anush/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands/console.rb:44:in
start' from /Users/Anush/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands/console.rb:8:in start’
from
/Users/Anush/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:23:in
<top (required)>' from script/rails:6:in require’
from script/rails:6:in `’

lenovo-t400:dtsV1 Anush$ which -a ruby
/Users/Anush/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
/Users/Anush/.rvm/bin/ruby

lenovo-t400:environments Anush$ vi
/Users/Anush/.rvm/environments/ruby-1.9.2-p180

export
PATH=“/Users/Anush/.rvm/gems/ruby-1.9.2-p180/bin:/Users/Anush/.rvm/gems/ruby-1.9.2-p180@global/bin:/Users/Anush/.rvm/rubies/ruby-1.9.2-p180/bin:/Users/Anush/.rvm/bin:$PATH”
rvm_path=‘/Users/Anush/.rvm’
export rvm_path
RUBY_VERSION=‘ruby-1.9.2-p180’
export RUBY_VERSION
GEM_HOME=‘/Users/Anush/.rvm/gems/ruby-1.9.2-p180’
export GEM_HOME
GEM_PATH=‘/Users/Anush/.rvm/gems/ruby-1.9.2-p180’
export GEM_PATH
MY_RUBY_HOME=‘/Users/Anush/.rvm/rubies/ruby-1.9.2-p180’
export MY_RUBY_HOME
IRBRC=‘/Users/Anush/.rvm/rubies/ruby-1.9.2-p180/.irbrc’
export IRBRC
rvm_ruby_string=‘ruby-1.9.2-p180’
export rvm_ruby_string
unset rvm_gemset_name
unset MAGLEV_HOME

lenovo-t400:environments Anush$ find gem env gemdir/gems/hpricot-*
-name *.bundle -ls
16323203 24 -rwxr-xr-x 1 Anush staff 10152 Apr 16
21:24
/Users/Anush/.rvm/gems/ruby-1.9.2-p180/gems/hpricot-0.8.4/ext/fast_xs/fast_xs.bundle
16323242 264 -rwxr-xr-x 1 Anush staff 134968 Apr 16
21:24
/Users/Anush/.rvm/gems/ruby-1.9.2-p180/gems/hpricot-0.8.4/ext/hpricot_scan/hpricot_scan.bundle
16323204 24 -rwxr-xr-x 1 Anush staff 10152 Apr 16
21:24
/Users/Anush/.rvm/gems/ruby-1.9.2-p180/gems/hpricot-0.8.4/lib/fast_xs.bundle
16323243 264 -rwxr-xr-x 1 Anush staff 134968 Apr 16
21:24
/Users/Anush/.rvm/gems/ruby-1.9.2-p180/gems/hpricot-0.8.4/lib/hpricot_scan.bundle

lenovo-t400:environments Anush$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.6.0]
lenovo-t400:environments Anush$ rails -v
Rails 3.0.6
lenovo-t400:environments Anush$ gem -v
1.6.2
lenovo-t400:environments Anush$ gem env
RubyGems Environment:

  • RUBYGEMS VERSION: 1.6.2
  • RUBY VERSION: 1.9.2 (2011-02-18 patchlevel 180)
    [x86_64-darwin10.6.0]
  • INSTALLATION DIRECTORY: /Users/Anush/.rvm/gems/ruby-1.9.2-p180
  • RUBY EXECUTABLE: /Users/Anush/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
  • EXECUTABLE DIRECTORY: /Users/Anush/.rvm/gems/ruby-1.9.2-p180/bin
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86_64-darwin-10
  • GEM PATHS:
    • /Users/Anush/.rvm/gems/ruby-1.9.2-p180
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :benchmark => false
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:

Thanks
Anush

On Apr 18, 7:12am, “Anush J.” [email protected] wrote:

Hi guys,
I wanted to fetch some info from webpage and use it in my db. I read
hpricot is one way to do it. But the problem is I’m unable to use it
with my app. For some reason after successfully installing hpricot it
fails when I try to use it in the rails console.

I’ve been trying to fix this for the last four-five days. I’m stumped !
I tried re-installing everything and still cant go past the error. Can
some one please help me, I really appreciate it !

Did you add it to your Gemfile?

Fred

Frederick C. wrote in post #993456:

On Apr 18, 7:12am, “Anush J.” [email protected] wrote:

Hi guys,
I wanted to fetch some info from webpage and use it in my db. I read
hpricot is one way to do it. But the problem is I’m unable to use it
with my app. For some reason after successfully installing hpricot it
fails when I try to use it in the rails console.

I’ve been trying to fix this for the last four-five days. I’m stumped !
I tried re-installing everything and still cant go past the error. Can
some one please help me, I really appreciate it !

Did you add it to your Gemfile?

Fred

Hey Fred,

Argh! I didnt knw about that.

[root@anushj testApp2]# rails c
Loading development environment (Rails 3.0.6)
irb(main):001:0> require ‘hpricot’
=> nil
irb(main):002:0>

I think it worked now, I wasted some time doing unwanted things.
Thanks a lot !!!

Anush