Ruby Hpricot

View: New views
5 Messages — Rating Filter:   Alert me  

Ruby Hpricot

by Bilal Aslam :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello




Code:
require 'rubygems'

require 'hpricot'

require 'open-uri'



url = "http://api.comicvine.com/characters/?api_key=(MYAPI)&format=xml"



doc = Hpricot( open( url ) )



puts (doc/"number_of_page_results").inner_html



puts "test"





When i try to run the file using Ctrl + f6 for testing the file

/usr/local/netbeans-6.5.1/ruby2/jruby-1.1.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:34:in `require': no such file to load -- hpricot (LoadError)



Any ideas?






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Ruby Hpricot

by Erno Mononen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

Can you double check that you have the hpricot gem installed for the
JRuby 1.1.4 platform you use? Note that the latest hpricot version
doesn't work with JRuby, please see
http://kenai.com/projects/jruby/pages/Hpricot for more info.

Erno


aslambilal wrote:

> Hello
>
>
>
>
> Code:
> require 'rubygems'
>
> require 'hpricot'
>
> require 'open-uri'
>
>
>
> url = "http://api.comicvine.com/characters/?api_key=(MYAPI)&format=xml"
>
>
>
> doc = Hpricot( open( url ) )
>
>
>
> puts (doc/"number_of_page_results").inner_html
>
>
>
> puts "test"
>
>
>
>
>
> When i try to run the file using Ctrl + f6 for testing the file
>
> /usr/local/netbeans-6.5.1/ruby2/jruby-1.1.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:34:in `require': no such file to load -- hpricot (LoadError)
>
>
>
> Any ideas?
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Ruby Hpricot

by Bilal Aslam :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks for the help :)



Now then, do i need to change the require line? I still have the same error with jruby1.1 installed and the hpricot gem.






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Ruby Hpricot

by Erno Mononen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


aslambilal wrote:
> Thanks for the help :)
>
>
>
> Now then, do i need to change the require line? I still have the same error with jruby1.1 installed and the hpricot gem.
>  

The require line should be fine; not sure now why you're still getting
that error. If you do

/usr/local/netbeans-6.5.1/ruby2/jruby-1.1.4/bin/jruby -S gem list hpricot


from the command line, what is the hpricot version it says you have
installed?

Erno


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Ruby Hpricot

by Bilal Aslam :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


restarted my vm a few times and it worked all of a sudden. Idk why.



Thanks again :)






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...