03/21
Sat
2009
http://github.com/scrubber/scrubyt_examples/tree/master
にあるサンプル、ebay.rbを動かす。
(最新のscRUBYt!をgemで依存関係を解決して淹れるだけだと
動かなかったので、苦戦。散々苦戦。)
○環境
VMware Server 2.0.0
Fedora 10
○結果
パッケージを下記のバージョンにすると動いた。
scRUBYt! 0.3.4
Hpricot 0.6
Mechanize 0.6.5
○詳細
●agent
http://scrubyt.org/blog/installing-firewatir-for-firefox-30/
のResponsによると、firefox2が必要なのはfirefoxをagentとする
firescRUBYt!を使う場合で、scRUBYt!はdefaultでMechanizeをangentとするらしい。
scRUBYtの0.4.1以上ではagentとしてfirefoxを使うようだ。
scRUBYt(>=0.4.1)を使おうとすると、firewatirを求めるエラーがでる。
[root@VMware1 cgi-test]# ./ebay.rb
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- firewatir (LoadError)
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/gems/1.8/gems/scrubyt-0.4.1/lib/scrubyt/core/navigation/agents/firewatir.rb:2
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/gems/1.8/gems/scrubyt-0.4.1/lib/scrubyt.rb:29
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from ./ebay.rb:4
「scRUBYt! 0.3.4ではfirefoxを使わずに動いている」 ととれる投稿が
あったので、scRUBYt!の0.3.4を指定してインストールする。
サンプルを実行すると、scRUBYt!の0.4.06のときのようなfirewatir関係の
エラーはでなくなった。
●依存関係
http://scrubyt.org/download.html によると、
>scRUBYt!のインストールは非常に簡単で下記を実行するだけ
>sudo gem install hpricot
>sudo gem install mechanize
>sudo gem install scrubyt
とのことだが、これだと各パッケージの最新が入ってしまいうまう。
http://wiki.scrubyt.org/index.php?title=Installation_Instructions にあるように、
Hpricot 0.6, Mchanize 0.6.5を指定してインストール。
●実行
以上の環境にすると動いた!
はじめに警告がでてるけど、まぁ大丈夫か。
[root@VMware1 cgi-test]# ./ebay.rb
/usr/lib/ruby/gems/1.8/gems/scrubyt-0.3.4/lib/scrubyt/core/scraping/filters/text_filter.rb:25: warning: don't put space before argument parentheses
http://shop.ebay.com/items/_W0QQ_nkwZipodQQ_armrsZ1QQ_fromZR40QQ_mdoZ
<root>
<record>
<name>Original Earphone Headphone for i Pod iPhone Nano TouchHIGH QUALITY*POWERSELLER*30 DAY GUARANTEE*IN STOCK$6.49Free shipping20d&#160;3h&#160;26m</name>
</record>
<record>
<name>EnlargeGriffin iTrip LCD FM Transmitter for iPod White NEW WBRAND NEW, FULL RETAIL PACKAGE, GREAT FOR GIFT GIVING!$9.9924d&#160;14h&#160;21m</name>
</record>
<record>
<name>EnlargeLeather Case Pouch For Apple iPod i Touch 8GB 16GB 32GBGlobally Ranked #3 eBay Power Seller *FREE SHIPPING*$6.99Free shipping1d&#160;21h&#160;50m</name>
</record>
<record>
<name>APPLE IPOD TOUCH 8GB VIDEO WiFi MP3 PLAYER 8 GB Grade AFree Ship, 90 Day Warranty, Newest Model in Retail Box16 Bids$180.00Free shipping46m</name>
</record>
<record>
(省略)
ようやくうごいた~、いやん♪
これからいろいろ使ってみよう。
03/20
Fri
2009
相変わらずscrubytのサンプルが動かない。
firewitireとfirefoxの関係化と思い、firefoxを2に
してみた。(Fedora10では標準でfirefox3が入っている。)
[環境]
VMware Server 2.0.0
Fedora 10
①firefox2.tar.gzを解凍し実行をこころみる。
→失敗
[root@VMware1 Server]# /tmp/firefox/firefox
/tmp/firefox/firefox-bin: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
②/usr/lib/libstdc++.so.6はあるので、/usr/lib/libstdc++.so.5から/usr/lib/libstdc++.so.6へリンク
を張って再度実行を試みる
→失敗。
[root@VMware1 Server]# /tmp/firefox/firefox
/tmp/firefox/firefox-bin: /usr/lib/libstdc++.so.5: version `GLIBCPP_3.2' not found (required by /tmp/firefox/firefox-bin)
/tmp/firefox/firefox-bin: /usr/lib/libstdc++.so.5: version `CXXABI_1.2' not found (required by /tmp/firefox/firefox-bin)
/tmp/firefox/firefox-bin: /usr/lib/libstdc++.so.5: version `GLIBCPP_3.2' not found (required by /tmp/firefox/libxpcom_core.so)
/tmp/firefox/firefox-bin: /usr/lib/libstdc++.so.5: version `CXXABI_1.2' not found (required by /tmp/firefox/libxpcom_core.so)
/tmp/firefox/firefox-bin: /usr/lib/libstdc++.so.5: version `GLIBCPP_3.2' not found (required by /tmp/firefox/libxpcom_compat.so)
③FedoraJP 掲示板(今日現在なぜか閲覧できない状態なのでgoogleのキャッシュ)に同様の書き込み
があったので、libstdc++.co.5のインストールを試みる。
・インストール
[root@VMware1 Server]# yum install compat-libstdc++-33
・libstdc++.so.5が入った。
[root@VMware1 Server]# ls -l /usr/lib/libstdc++.so.
libstdc++.so.5 libstdc++.so.6
libstdc++.so.5.0.7 libstdc++.so.6.0.10
[root@VMware1 Server]# ls -l /usr/lib/libstdc++.so.5
lrwxrwxrwx 1 root root 18 2009-03-15 08:03 /usr/lib/libstdc++.so.5 -> libstdc++.so.5.0.7
④山ほど警告(?)がでてるけど、firefox2起動!
[root@VMware1 Server]# /tmp/firefox/firefox
Loading socket Config module ...
Creating backend ...
Loading x11 FrontEnd module ...
Failed to load x11 FrontEnd module.
Loading simple Config module ...
Creating backend ...
desc table has been created.
Loading socket FrontEnd module ...
Starting SCIM as daemon ...
desc table has been created.
Failed to open the panel socket
GConf エラー: 設定サーバ (gconfd) との接続に失敗しました: いくつか発生する可能性として、ORBit の TCP/IP ネットワークを有効にしていない、あるいはお使いのシステムで古い NFS のロックがクラッシュを引き起こしたことが考えられます。これに関連する情報については http://www.gnome.org/projects/gconf/ を参照して下さい (詳細 - 1: セッションへの接続に失敗しました: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)
GConf エラー: 設定サーバ (gconfd) との接続に失敗しました: いくつか発生する可能性として、ORBit の TCP/IP ネットワークを有効にしていない、あるいはお使いのシステムで古い NFS のロックがクラッシュを引き起こしたことが考えられます。これに関連する情報については http://www.gnome.org/projects/gconf/ を参照して下さい (詳細 - 1: セッションへの接続に失敗しました: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)
Loading socket Config module ...
Creating backend ...
Loading x11 FrontEnd module ...
Failed to load x11 FrontEnd module.
Loading simple Config module ...
Creating backend ...
desc table has been created.
Loading socket FrontEnd module ...
Starting SCIM as daemon ...
desc table has been created.
GConf エラー: 設定サーバ (gconfd) との接続に失敗しました: いくつか発生する可能性として、ORBit の TCP/IP ネットワークを有効にしていない、あるいはお使いのシステムで古い NFS のロックがクラッシュを引き起こしたことが考えられます。これに関連する情報については http://www.gnome.org/projects/gconf/ を参照して下さい (詳細 - 1: セッションへの接続に失敗しました: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)
GConf エラー: 設定サーバ (gconfd) との接続に失敗しました: いくつか発生する可能性として、ORBit の TCP/IP ネットワークを有効にしていない、あるいはお使いのシステムで古い NFS のロックがクラッシュを引き起こしたことが考えられます。これに関連する情報については http://www.gnome.org/projects/gconf/ を参照して下さい (詳細 - 1: セッションへの接続に失敗しました: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.)
⑤/usr/lib/firefox(firefox3起動)をリネームし、/usr/lib/firefox から 2の方が起動する
ようにシンボリックリンクを張る。
→firefox 標準で2が動くようになった。
相変わらずscrubytのサンプルはうごかんなー。んー。
03/19
Thu
2009
03/19
Thu
2009
03/17
Tue
2009