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.
> 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:
>> 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
>> On Tue, Dec 22, 2009 at 11:32 PM, TOBY
>> <toby.net.info.m...@gmail.com> wrote:
>>> 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 athttp://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 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.
>>>> On Tue, Dec 22, 2009 at 7:59 PM, TOBY
>>>> <toby.net.info.m...@gmail.com>
>>> wrote:
>>>>> 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 received this message because you are subscribed to the Google
>>> Groups
>>>>> "Google App Engine API Wrappers for JRuby" group.
>>>>> To post to this group, send email to appengine-jruby@googlegroups.com
>>>>> .
>>>>> To unsubscribe from this group, send email to
>>>>> appengine-jruby+unsubscribe@googlegroups.com<appengine-jruby%2Bunsubscribe@ googlegroups.com
>>> <appengine-jruby%2Bunsubscribe@googlegroups.com<appengine-jruby%252Bunsubsc ribe@googlegroups.com
>>>>> .
>>>>> For more options, visit this group at
...