Ruby 初心者スレッド Part 34at TECH
Ruby 初心者スレッド Part 34 - 暇つぶし2ch157:デフォルトの名無しさん
10/02/03 15:20:42
Windows上でMechanizeを使おうと考えており下記のスクリプトを試しましたが下記のような結果となりました
何がおかしいのか見当つかないのでどなたかアドバイスいただけないでしょうかよろしくお願いいたします

* 環境
>ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i386-mswin32]
>gem list
*** LOCAL GEMS ***
hpricot (0.8.2)
mechanize (0.9.3)
nokogiri (1.4.1)

* テストスクリプト
require 'rubygems'
require 'mechanize'
agent = WWW::Mechanize.new
page = agent.get('URLリンク(www.google.com)')
puts page.forms
puts page.forms.with

* 結果
>ruby -d hoge.rb
Exception `LoadError' at C:/PROGRA~1/ruby-1.8/lib/ruby/vendor_ruby/1.8/rubygems.rb:1112 - no such file to load -- rubygems/defaults/operating_system
Exception `NoMethodError' at C:/PROGRA~1/ruby-1.8/lib/ruby/1.8/rational.rb:78 -undefined method `gcd' for Rational(1, 2):Rational
Exception `LoadError' at C:/PROGRA~1/ruby-1.8/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31 - no such file to load -- mechanize
#<WWW::Mechanize::Form:0x381a3a0>
Exception `NoMethodError' at C:/PROGRA~1/ruby-1.8/lib/ruby/1.8/pp.rb:214 - undefined method `with' for #<Array:0x381a4e0>
hoge.rb:7: undefined method `with' for #<Array:0x381a4e0> (NoMethodError)


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch