Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to use mechanize on appengine-jruby?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
TOBY  
View profile  
 More options Dec 22 2009, 10:59 pm
From: TOBY <toby.net.info.m...@gmail.com>
Date: Tue, 22 Dec 2009 19:59:08 -0800 (PST)
Local: Tues, Dec 22 2009 10:59 pm
Subject: How to use mechanize on appengine-jruby?
I tried to use mechanize, but failed it. (It's error of bundler ??)
How to use mechanize on appengine-jruby?

added in Gemfile:

gem "hpricot"
gem "mechanize"

I run it:
 dev_appserver.rb .

error messages:

dev_appserver.rb .
=> Booting DevAppServer
=> Press Ctrl-C to shutdown server
=> Bundling gems
Calculating dependencies...
Updating source: http://gems.rubyforge.org
ERROR:  While executing gem ... (ArgumentError)
    comparison of Array with Array failed


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Woodell  
View profile  
 More options Dec 22 2009, 11:08 pm
From: John Woodell <mando.woo...@gmail.com>
Date: Tue, 22 Dec 2009 20:08:47 -0800
Local: Tues, Dec 22 2009 11:08 pm
Subject: Re: How to use mechanize on appengine-jruby?

You may need to explicitly request an older version of mechanize.

We also just pushed out a new version of appengine-tools
that patches the issue you are having.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
TOBY  
View profile  
 More options Dec 23 2009, 2:32 am
From: TOBY <toby.net.info.m...@gmail.com>
Date: Tue, 22 Dec 2009 23:32:51 -0800 (PST)
Local: Wed, Dec 23 2009 2:32 am
Subject: Re: How to use mechanize on appengine-jruby?
OK.

Sorry, I forgot to send enviroments.

* Windows Vista SP2
* Ruby(MRI) 1.8.7
* JDK 1.6.0_17
* bundler (0.7.2)
* google-appengine (0.0.6 -> 0.0.7)  upps. .I retryed new version..

I think maybe  if it's because bundler of windows...

Next. I tried it Ubuntu 9.04 on coLinux.

At cofs filesystem files it has following error,

$ dev_appserver.rb .
=> Booting DevAppServer
=> Press Ctrl-C to shutdown server
=> Bundling gems
Calculating dependencies...
Updating source: http://gems.rubyforge.org
Downloading addressable-2.1.1.gem
Downloading appengine-apis-0.0.12.gem
 :
Installing dm-core (0.10.2)
Installing dm-appengine (0.0.7)
Done.
=> Packaging gems
/usr/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:1246:in
`read': No such file or directory - ./WEB-INF/lib/gems.jar
(Errno::ENOENT)
        from /usr/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:1246:in
`get_e_o_c_d'
        from /usr/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:1204:in
`read_e_o_c_d'
        from /usr/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:1229:in
`read_from_stream'
        from /usr/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:1361:in
`initialize'
        from /usr/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:1361:in
`open'
        from /usr/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:1361:in
`initialize'
        from /usr/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:1487:in
`commit'
        from /usr/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:1492:in
`close'
        from /usr/lib/ruby/gems/1.8/gems/rubyzip-0.9.1/lib/zip/zip.rb:1384:in
`open'
        from /usr/lib/ruby/gems/1.8/gems/appengine-tools-0.0.7/lib/appengine-
tools/gem_bundler.rb:80:in `gem_bundle'
        from /usr/lib/ruby/gems/1.8/gems/appengine-tools-0.0.7/lib/appengine-
tools/gem_bundler.rb:44:in `bundle'
        from /usr/lib/ruby/gems/1.8/gems/appengine-tools-0.0.7/lib/appengine-
tools/bundler.rb:129:in `bundle_gems'
        from /usr/lib/ruby/gems/1.8/gems/appengine-tools-0.0.7/lib/appengine-
tools/bundler.rb:120:in `bundle_deps'
        from /usr/lib/ruby/gems/1.8/gems/appengine-tools-0.0.7/lib/appengine-
tools/bundler.rb:114:in `bundle'
        from /usr/lib/ruby/gems/1.8/gems/appengine-tools-0.0.7/lib/appengine-
tools/bundler.rb:291:in `bundle_app'
        from /usr/lib/ruby/gems/1.8/gems/appengine-tools-0.0.7/lib/appengine-
tools/dev_appserver.rb:32:in `run'
        from /usr/lib/ruby/gems/1.8/gems/appengine-tools-0.0.7/bin/
dev_appserver.rb:18
        from /usr/bin/dev_appserver.rb:19:in `load'
        from /usr/bin/dev_appserver.rb:19

Next, NOT cofs filesystem files has no error on bundler packaging.
However, "require 'mechanize'" has an error, "no such file to load --
ffi/ffi".

$ dev_appserver.rb .
=> Booting DevAppServer
=> Press Ctrl-C to shutdown server
=> Bundling gems
Calculating dependencies...
Updating source: http://gems.rubyforge.org
Downloading addressable-2.1.1.gem
Downloading appengine-apis-0.0.12.gem
Downloading appengine-rack-0.0.6.gem
Downloading dm-appengine-0.0.7.gem
Downloading dm-core-0.10.2.gem
Downloading extlib-0.9.14.gem
Downloading mechanize-0.9.3.gem
Downloading nokogiri-1.4.1-java.gem
Downloading rack-1.0.1.gem
Downloading sinatra-0.9.4.gem
Installing nokogiri (1.4.1)
Installing extlib (0.9.14)
Installing rack (1.0.1)
Installing sinatra (0.9.4)
Installing mechanize (0.9.3)
Installing appengine-rack (0.0.6)
Installing appengine-apis (0.0.12)
Installing addressable (2.1.1)
Installing dm-core (0.10.2)
Installing dm-appengine (0.0.7)
Done.
=> Packaging gems
=> Installing JRuby
=> Installing jruby-rack
=> Installing appengine-sdk
=> Generating configuration files
The server is running at http://localhost:8080/
Sinatra::Reloader: reseting routes
no such file to load -- ffi/ffi

Conclusion,

* bundler 0.7.2 is buggy in Windows ??
* I tried to older version of mechanize..?

On 12月23日, 午後1:08, John Woodell <mando.woo...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Woodell  
View profile  
 More options Dec 23 2009, 5:51 am
From: John Woodell <mando.woo...@gmail.com>
Date: Wed, 23 Dec 2009 02:51:12 -0800
Local: Wed, Dec 23 2009 5:51 am
Subject: Re: How to use mechanize on appengine-jruby?

We've removed FFI from our version of jruby, it won't ever work on
production.
You need to find an older version of mechanize that works with hpricot,
and see if it works with the most current version of hpricot.

We hope we will have a pure Java version of nokogiri sometime soon,
but for now, if required native libraries, and won't work on App Engine.

Downloading mechanize-0.9.3.gem
Downloading nokogiri-1.4.1-java.gem  <-  not going to work


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
TOBY  
View profile  
 More options Dec 24 2009, 4:56 am
From: TOBY <toby.net.info.m...@gmail.com>
Date: Thu, 24 Dec 2009 01:56:44 -0800 (PST)
Local: Thurs, Dec 24 2009 4:56 am
Subject: Re: How to use mechanize on appengine-jruby?
Hi, thank you for your reply.

I tried to use old "mechanize-0.8.5" and "hpricot-0.8.2-java" at
Ubuntu 9.04 on coLinux.
I modified to like following in Gemfile.

 #gem "nokogiri"
 gem "mechanize", "0.8.5"

Next... I added following in main .rb file and ran "dev_appserver ."
 require 'hpricot'
or
 require 'mechanize'

But an error has occured.
Because this is long error,  I write similar error at irb's.

irb(main):004:0> require 'hpricot'
NameError: undefined method `content' for class `Hpricot::CData'
        from file:/home/pubuntu/test/google-appengine/WEB-INF/lib/gems.jar!/
bundler_gems/gems/hpricot-0.8.2-java/lib/hpricot/tag.rb:153
        from file:/home/pubuntu/test/google-appengine/WEB-INF/lib/gems.jar!/
bundler_gems/gems/hpricot-0.8.2-java/lib/hpricot/tag.rb:21:in
`require'
        from file:/home/pubuntu/test/google-appengine/WEB-INF/lib/gems.jar!/
bundler_gems/gems/hpricot-0.8.2-java/lib/hpricot.rb:21
        from file:/home/pubuntu/test/google-appengine/WEB-INF/lib/gems.jar!/
bundler_gems/gems/hpricot-0.8.2-java/lib/hpricot.rb:5:in `require'
        from (irb):5
irb(main):005:0> require 'mechanize'
NameError: undefined method `content' for class `Hpricot::CData'
        from file:/home/pubuntu/test/google-appengine/WEB-INF/lib/gems.jar!/
bundler_gems/gems/hpricot-0.8.2-java/lib/hpricot/tag.rb:153
        from file:/home/pubuntu/test/google-appengine/WEB-INF/lib/gems.jar!/
bundler_gems/gems/hpricot-0.8.2-java/lib/hpricot/tag.rb:21:in
`require'
        from file:/home/pubuntu/test/google-appengine/WEB-INF/lib/gems.jar!/
bundler_gems/gems/hpricot-0.8.2-java/lib/hpricot.rb:21
        from file:/home/pubuntu/test/google-appengine/WEB-INF/lib/gems.jar!/
bundler_gems/gems/hpricot-0.8.2-java/lib/hpricot.rb:9:in `require'
        from file:/home/pubuntu/test/google-appengine/WEB-INF/lib/gems.jar!/
bundler_gems/gems/mechanize-0.8.5/lib/www/mechanize.rb:9
        from file:/home/pubuntu/test/google-appengine/WEB-INF/lib/gems.jar!/
bundler_gems/gems/mechanize-0.8.5/lib/www/mechanize.rb:7:in `require'
        from file:/home/pubuntu/test/google-appengine/WEB-INF/lib/gems.jar!/
bundler_gems/gems/mechanize-0.8.5/lib/mechanize.rb:7
        from file:/home/pubuntu/test/google-appengine/WEB-INF/lib/gems.jar!/
bundler_gems/gems/mechanize-0.8.5/lib/mechanize.rb:6:in `require'
        from (irb):6

I see sources of hpricot a little. (in .gems/bundler_gems/gems/
hpricot-0.8.2-java/lib/hpricot/tag.rb)

   class CData
    def initialize content; self.content = content end       # <-
NameError: undefined method `content' for class `Hpricot::CData'
    alias_method :to_s, :content
    alias_method :to_plain_text, :content
    alias_method :inner_text, :content
    def raw_string; "<![CDATA[#{content}]]>" end
    def output(out, opts = {})
      out <<
        if_output(opts) do
          "<![CDATA[#{content}]]>"
        end
    end
  end

Then,  I tried to run"require 'hpricot'" at some enviroments.

* Ruby 1.8.7 on Windows Vista ... OK
* Ruby 1.8.7 on Ubuntu 9.04(coLinux) ... OK
* JRuby 1.4 on Windows Vista ... OK
* appengine-jruby 0.0.7 on Ubuntu 9.04(coLinux) ... Error!

Hummm... What can I do for this problem?

Thanks,

On Dec 23, 7:51 pm, John Woodell <mando.woo...@gmail.com> wrote:

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin Mazur  
View profile  
 More options Dec 26 2009, 4:44 am
From: Martin Mazur <m...@upplopp.se>
Date: Sat, 26 Dec 2009 10:44:22 +0100
Local: Sat, Dec 26 2009 4:44 am
Subject: Re: How to use mechanize on appengine-jruby?
Hello TOBY,

I get the same error when trying to include hpricot. Did you find any  
solution for this issue?

I think this is a hpricot, appengine, jruby problem. I'll continue  
playing around with it and post here if I find anything new out.

//M

On 24 dec 2009, at 10.56, TOBY wrote:

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »