FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Ruby Hpricot

 
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users
View previous topic :: View next topic  
Author Message
aslambilal



Joined: 28 Jun 2009
Posts: 3

PostPosted: Sun Jun 28, 2009 2:30 am    Post subject: Ruby Hpricot Reply with quote

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
Code:

/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?

P.S. When i run it from terminal it works fine, no errors

Code:

100
test
[/code]
Back to top
View user's profile Send private message
Erno Mononen
Posted via mailing list.





PostPosted: Mon Jun 29, 2009 8:49 am    Post subject: Ruby Hpricot Reply with quote

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:
Quote:
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?











Back to top
aslambilal



Joined: 28 Jun 2009
Posts: 3

PostPosted: Mon Jun 29, 2009 10:13 pm    Post subject: Reply with quote

Thanks for the help Smile

Now then, do i need to change the require line? I still have the same error with jruby1.1 installed and the hpricot gem.
Back to top
View user's profile Send private message
Erno Mononen
Posted via mailing list.





PostPosted: Tue Jun 30, 2009 2:09 pm    Post subject: Ruby Hpricot Reply with quote

aslambilal wrote:
Quote:
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
Back to top
aslambilal



Joined: 28 Jun 2009
Posts: 3

PostPosted: Tue Jun 30, 2009 8:27 pm    Post subject: Reply with quote

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

Thanks again Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB