Hi, I''m trying to install mechanize as macruby and it gives the following error: $sudo macgem install mechanize ERROR: While executing gem ... (NoMethodError) undefined method `to_str'' for #<Errno::EAGAIN:0x401198020> Is there a way around this? * * Chim K. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mechanize-users/attachments/20120913/dd3b99dc/attachment.html>
Can you run: sudo macgem install --backtrace mechanize and copy/paste the full output here? -- Kenny Meyer http://www.kennymeyer.net @meyerkenny On Thursday, September 13, 2012 at 1:01 AM, Chim Kan wrote:> Hi, > > I''m trying to install mechanize as macruby and it gives the following error: > > $sudo macgem install mechanize > > ERROR: While executing gem ... (NoMethodError) > undefined method `to_str'' for #<Errno::EAGAIN:0x401198020> > > Is there a way around this? > > Chim K. > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org (mailto:Mechanize-users at rubyforge.org) > http://rubyforge.org/mailman/listinfo/mechanize-users
So, I tried to install again now and it worked. Kind of weird. Tks! On Thu, Sep 13, 2012 at 9:38 AM, Kenny <kenny at kennymeyer.net> wrote:> Can you run: > > sudo macgem install --backtrace mechanize > > and copy/paste the full output here? > > -- > Kenny Meyer > http://www.kennymeyer.net > @meyerkenny > > > On Thursday, September 13, 2012 at 1:01 AM, Chim Kan wrote: > > > Hi, > > > > I''m trying to install mechanize as macruby and it gives the following > error: > > > > $sudo macgem install mechanize > > > > ERROR: While executing gem ... (NoMethodError) > > undefined method `to_str'' for #<Errno::EAGAIN:0x401198020> > > > > Is there a way around this? > > > > Chim K. > > _______________________________________________ > > Mechanize-users mailing list > > Mechanize-users at rubyforge.org (mailto:Mechanize-users at rubyforge.org) > > http://rubyforge.org/mailman/listinfo/mechanize-users > > > > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mechanize-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mechanize-users/attachments/20120913/cb752ec1/attachment.html>
Hmm, so I tried this out just to see what''s gonna happen, and I got this: mbp:godfrey ~ $ sudo macgem install --backtrace mechanize ERROR: While executing gem ... (TypeError) TypeError /Library/Frameworks/MacRuby.framework/Versions/0.12/usr/lib/ruby/1.9.2/stringio.rb:140:in `read'' /Library/Frameworks/MacRuby.framework/Versions/0.12/usr/lib/ruby/1.9.2/stringio.rb:166:in `read_nonblock'' /usr/local/bin/macgem:21:in `<main>'' mbp:godfrey ~ $ sudo macgem install mechanize ERROR: While executing gem ... (NoMethodError) undefined method `to_str'' for #<Errno::EAGAIN:0x40566e1a0> mbp:godfrey ~ $ sudo macgem install --backtrace mechanize ERROR: While executing gem ... (TypeError) class Gem::Specification needs to have method `_load'' /usr/local/bin/macgem:21:in `<main>'' mbp:godfrey ~ $ sudo macgem install --backtrace mechanize Fetching: net-http-digest_auth-1.2.1.gem (100%) Fetching: net-http-persistent-2.7.gem (100%) Fetching: mime-types-1.19.gem (100%) Fetching: nokogiri-1.5.5.gem (100%) Building native extensions. This could take a while... Fetching: ntlm-http-0.1.1.gem (100%) WARNING: ntlm-http-0.1.1 has an invalid nil value for @cert_chain Fetching: webrobots-0.0.13.gem (100%) Fetching: unf_ext-0.0.5.gem (100%) Building native extensions. This could take a while... Fetching: unf-0.0.5.gem (100%) Fetching: domain_name-0.5.3.gem (100%) Fetching: mechanize-2.5.1.gem (100%) Successfully installed net-http-digest_auth-1.2.1 Successfully installed net-http-persistent-2.7 Successfully installed mime-types-1.19 Successfully installed nokogiri-1.5.5 Successfully installed ntlm-http-0.1.1 Successfully installed webrobots-0.0.13 Successfully installed unf_ext-0.0.5 Successfully installed unf-0.0.5 Successfully installed domain_name-0.5.3 Successfully installed mechanize-2.5.1 10 gems installed mbp:godfrey ~ $ macruby is like a box of magic! Godfrey On 2012-09-13, at 7:48 AM, Chim Kan wrote:> So, I tried to install again now and it worked. Kind of weird. Tks! > > On Thu, Sep 13, 2012 at 9:38 AM, Kenny <kenny at kennymeyer.net> wrote: > Can you run: > > sudo macgem install --backtrace mechanize > > and copy/paste the full output here? > > -- > Kenny Meyer > http://www.kennymeyer.net > @meyerkenny > > > On Thursday, September 13, 2012 at 1:01 AM, Chim Kan wrote: > > > Hi, > > > > I''m trying to install mechanize as macruby and it gives the following error: > > > > $sudo macgem install mechanize > > > > ERROR: While executing gem ... (NoMethodError) > > undefined method `to_str'' for #<Errno::EAGAIN:0x401198020> > > > > Is there a way around this? > > > > Chim K. > > _______________________________________________ > > Mechanize-users mailing list > > Mechanize-users at rubyforge.org (mailto:Mechanize-users at rubyforge.org) > > http://rubyforge.org/mailman/listinfo/mechanize-users > > > > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mechanize-users > > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mechanize-users-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mechanize-users/attachments/20120913/5aafdfcc/attachment-0001.html>
It happened to me the same exact thing. However, I''m getting this warning from Nokogiri: [50][chimkan: /Users/chimkan/Core/sources/experiments/Hello]$ macirb irb(main):001:0> require ''mechanize'' WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8 => true irb(main):002:0> It takes 2 seconds to load Nokogiri. I googled for this error, but it''s not clear what''s happening. Then I loaded this code https://gist.github.com/3716112 : [54][chimkan: /Users/chimkan/Core/sources/experiments/Hello]$ macirb irb(main):001:0> require ''mechanize'' WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8 => true irb(main):002:0> keyword = ''mixer'' => "mixer" irb(main):003:0> @target_url = " http://www.canadiantire.ca/search/search_results.jsp?bmForm=form_endeca_search&bmFormID=1343016irb(main):003:0> @target_url = " http://www.canadiantire.ca/search/search_results.jsp?bmForm=form_endeca_search&bmFormID=1343016788618&bmUID=1343016788618&bmIsForm=true&bmText=quick_search_term&quick_search_term=#{keyword}&bmSubmit=quick_search " => " http://www.canadiantire.ca/search/search_results.jsp?bmForm=form_endeca_search&bmFormID=1343016788618&bmUID=1343016788618&bmIsForm=true&bmText=quick_search_term&quick_search_term=mixer&bmSubmit=quick_search " irb(main):004:0> @agent = Mechanize.new => #<Mechanize #<Mechanize::CookieJar:0x400bbf440 @jar={}> nil> irb(main):005:0> @agent.get(@target_url) *Segmentation fault: 11* [55][chimkan: /Users/chimkan/Core/sources/experiments/Hello]$ I also tried googling "segmentation fault: 11" but I can''t find anything. Is something wrong with Nokogiri or mechanize? Cheers, On Thu, Sep 13, 2012 at 12:47 PM, Godfrey Chan <godfreykfc at gmail.com> wrote:> Hmm, so I tried this out just to see what''s gonna happen, and I got this: > > mbp:godfrey ~ $ sudo macgem install --backtrace mechanize > ERROR: While executing gem ... (TypeError) > TypeError > /Library/Frameworks/MacRuby.framework/Versions/0.12/usr/lib/ruby/1.9.2/stringio.rb:140:in > `read'' > /Library/Frameworks/MacRuby.framework/Versions/0.12/usr/lib/ruby/1.9.2/stringio.rb:166:in > `read_nonblock'' > /usr/local/bin/macgem:21:in `<main>'' > > mbp:godfrey ~ $ sudo macgem install mechanize > ERROR: While executing gem ... (NoMethodError) > undefined method `to_str'' for #<Errno::EAGAIN:0x40566e1a0> > > mbp:godfrey ~ $ sudo macgem install --backtrace mechanize > ERROR: While executing gem ... (TypeError) > class Gem::Specification needs to have method `_load'' > /usr/local/bin/macgem:21:in `<main>'' > > mbp:godfrey ~ $ sudo macgem install --backtrace mechanize > Fetching: net-http-digest_auth-1.2.1.gem (100%) > Fetching: net-http-persistent-2.7.gem (100%) > Fetching: mime-types-1.19.gem (100%) > Fetching: nokogiri-1.5.5.gem (100%) > Building native extensions. This could take a while... > Fetching: ntlm-http-0.1.1.gem (100%) > WARNING: ntlm-http-0.1.1 has an invalid nil value for @cert_chain > Fetching: webrobots-0.0.13.gem (100%) > Fetching: unf_ext-0.0.5.gem (100%) > Building native extensions. This could take a while... > Fetching: unf-0.0.5.gem (100%) > Fetching: domain_name-0.5.3.gem (100%) > Fetching: mechanize-2.5.1.gem (100%) > Successfully installed net-http-digest_auth-1.2.1 > Successfully installed net-http-persistent-2.7 > Successfully installed mime-types-1.19 > Successfully installed nokogiri-1.5.5 > Successfully installed ntlm-http-0.1.1 > Successfully installed webrobots-0.0.13 > Successfully installed unf_ext-0.0.5 > Successfully installed unf-0.0.5 > Successfully installed domain_name-0.5.3 > Successfully installed mechanize-2.5.1 > 10 gems installed > > mbp:godfrey ~ $ > > macruby is like a box of magic! > > Godfrey > > On 2012-09-13, at 7:48 AM, Chim Kan wrote: > > So, I tried to install again now and it worked. Kind of weird. Tks! > > On Thu, Sep 13, 2012 at 9:38 AM, Kenny <kenny at kennymeyer.net> wrote: > >> Can you run: >> >> sudo macgem install --backtrace mechanize >> >> and copy/paste the full output here? >> >> -- >> Kenny Meyer >> http://www.kennymeyer.net >> @meyerkenny >> >> >> On Thursday, September 13, 2012 at 1:01 AM, Chim Kan wrote: >> >> > Hi, >> > >> > I''m trying to install mechanize as macruby and it gives the following >> error: >> > >> > $sudo macgem install mechanize >> > >> > ERROR: While executing gem ... (NoMethodError) >> > undefined method `to_str'' for #<Errno::EAGAIN:0x401198020> >> > >> > Is there a way around this? >> > >> > Chim K. >> > _______________________________________________ >> > Mechanize-users mailing list >> > Mechanize-users at rubyforge.org (mailto:Mechanize-users at rubyforge.org) >> > http://rubyforge.org/mailman/listinfo/mechanize-users >> >> >> >> _______________________________________________ >> Mechanize-users mailing list >> Mechanize-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mechanize-users >> > > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mechanize-users > > > > _______________________________________________ > Mechanize-users mailing list > Mechanize-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mechanize-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/mechanize-users/attachments/20120913/4b47f7cb/attachment.html>