Forum: JRuby Hpricot Gem Problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Josef S. (Guest)
on 2009-04-17 19:27
Hi Guys,

I have the following situation.
I am using a the Hpricot gem in my rails app. As some of you know, jruby
cannot build native extensions, and the latest versions of hpricot, have
the native extensions and therefore they dont work with jruby. I
installed the hpricot-0.6.159-java gem wich works fine with my
application.

When i warble the application with ruby (not jruby) i get the following
error:

rake aborted!
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
`gem_original_require': no such file to load -- hpricot_scan
c:/ruby/lib/ruby/gems/1.8/gems/warbler-0.9.12/lib/warbler/task.rb:40:in
`initialize'
(See full trace by running task with --trace)

if i install the latest hpricot gem with the native extensions, the
warble works, but the applciation doesnt

If i try to warble with jruby, i get the following:

rake aborted!
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
`gem_original_require': no such file to load -- hpricot_scan
c:/ruby/lib/ruby/gems/1.8/gems/warbler-0.9.12/lib/warbler/task.rb:40:in
`initialize'
(See full trace by running task with --trace)

The other solution i  thought about, was to require the hpricot gem
version i want. i do this in my environment.rb right before
Rails::Initializer.run do |config| with the following

require 'open-uri'
gem 'hpricot', '= 0.6.159'
require 'hpricot'

when i start the app, i get the message:

C:/../rubygems.rb:150:in `activate': can't activate hpricot (= 0.6.159,
runtime), already activated hpricot-0.8.1-x86-mswin32 (Gem::Exception)

What can i do?

Thanks in advance
This topic is locked and can not be replied to.