« Windows XP SP3統合ディスクの作成 | ホーム | OpenFLの未読最大件数を200件にした »
2008年5月24日
OpenFL + MySQL + Plagger::Plugin::Store::Fastladder 入れた
Web Service版のFastladderがTumblrのFeedに占領されたので追加のアカウント取ったんだけど切り替えが面倒くさい。
今あるLDRのFeedをOpenFLで読むようにすればLDRも画像関連に振れるんじゃね?ということで、インストールしたまま放ったらかしだったOpenFLがついに日の目を見る。
アジェンダ
- MySQLのインストール
- OpenFLのDB設定
- DBD::mysqlのインストール
- Store::Fastladderのインストール
- Plaggerでクローラーを動かす
4までほぼしゅにたんの記事をなぞっただけ。
参考
MySQLのインストール
$ sudo port install mysql5 +setver
---> Verifying checksum(s) for mysql5
Error: Checksum (md5) mismatch for mysql-5.0.51.tar.gz
Error: Checksum (sha1) mismatch for mysql-5.0.51.tar.gz
Error: Checksum (rmd160) mismatch for mysql-5.0.51.tar.gz
Error: Target org.macports.checksum returned: Unable to verify file checksums
いきなり転けた><
$ sudo port sync
とかしてたら出来るようになった。
$ sudo port install mysql5 +server
---> Verifying checksum(s) for mysql5
Error: Target org.macports.checksum returned: Could not open file: /opt/local/var/macports/distfiles/mysql5/mysql-5.0.51a.tar.gz
Error: Status 1 encountered during processing.
ひゃー。
エラーでググったらクリーンすれば良さそう。
$ sudo port clean --all mysql5
---> Cleaning mysql5
今度こそ。
$ sudo port install mysql5 +server
---> Fetching mysql5
---> Attempting to fetch mysql-5.0.51a.tar.gz from http://mysql.mirrors.pair.com/Downloads/MySQL-5.0/
---> Verifying checksum(s) for mysql5
---> Extracting mysql5
---> Configuring mysql5
---> Building mysql5 with target all
---> Staging mysql5 into destroot
---> Creating launchd control script
###########################################################
# A startup item has been generated that will aid in
# starting mysql5 with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
###########################################################
---> Installing mysql5 5.0.51a_0+server
******************************************************
* In order to setup the database, you might want to run
* sudo -u mysql mysql_install_db5
* if this is a new install
******************************************************
---> Activating mysql5 5.0.51a_0+server
---> Cleaning mysql5
できた。
あとはしゅにたんの記事の通りに。
OpenFLのDB設定
まずOpenFLの最新版を入手。以前インストールしたときはsvnを使わなかったので、ディレクトリ名指定で上書きしてみる。
$ cd ~/Sites/openfl
$ svn co http://fastladder.googlecode.com/svn/trunk/ fastladder
database.ymlをMySQL用にしてproduction項を編集。
$ cd fastladder
$ cp config/database.yml.mysql config/database.yml
$ vim config/database.yml
...
production:
adapter: mysql
encoding: utf8
database: fastladder_production
username: root
password:
socket: /opt/local/var/run/mysql5/mysqld.sock
DBを初期化。
$ mysqladmin5 -u root create fastladder_production
$ RAILS_ENV=production rake db:migrate
起動。
$ script/server -e -d production
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with -d environment...
Exiting
/opt/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:206:in `read': No such file or directory - /Users/Madhat/Sites/openfl/fastladder/config/environments/-d.rb (Errno::ENOENT)
from /opt/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:206:in `load_environment'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
from /opt/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:199:in `load_environment'
from /opt/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:91:in `process'
from /opt/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:49:in `send'
from /opt/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/initializer.rb:49:in `run'
from /Users/Madhat/Sites/openfl/fastladder/config/environment.rb:13
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
... 25 levels...
from /opt/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from script/server:3
なんぞー。
って、-e と -d が逆?
$ script/server -d -e production
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
動いた。しゅにたんめ( ゚皿゚)
http://0.0.0.0:3000/ にアクセスしてアカウントを作成。
DBD:mysqlのインストール
$ sudo cpan -i DBD::mysql
...
Can't locate DBI/DBD.pm in @INC ...
DBI::DBDが無いって怒られたので先にインストール。
$ sudo cpan -i DBI::DBD
ワンモア。
$ sudo cpan -i DBD::mysql
...
Running make test
Make had some problems, maybe interrupted? Won't test
Running make install
Make had some problems, maybe interrupted? Won't install
MySQLのコンフィグにシンボリックリンクを張る。
sudo ln -s /opt/local/lib/mysql5/bin/mysql_config /usr/local/bin/mysql_config
cpanの作業ディレクトリに移動。と思ったんだけど DBD-mysql-.*/ が無い!
......って、場所が違った罠。
$ cd /var/root/.cpan/build/DBD-mysql-4.007
-bash: cd: /var/root/.cpan/build/DBD-mysql-4.007: Permission denied
パーミッションで怒られた。
$ su root
Password:
su: Sorry
なんでだっけ。
しょうがないので一時的に /var/root/ のアクセス権変えた。
$ cd /var/root/.cpan
$ sudo perl Makefile.PL --cflags=-I/opt/local/include/mysql5/mysql "--libs=-L/opt/local/lib -L/opt/local/lib/mysql5/mysql -lmysqlclient -L/opt/local/lib -lz -lm -L/opt/local/lib -lssl -lcrypto"
...
Writing Makefile for DBD::mysql
準備完了。makeする。
$ sudo make
$ sudo make test
$ sudo make install
Store::Fastladderのインストール
$ cd ~/Sites/openfl/
$ svn co http://svn.bulknews.net/repos/plagger/branches/fastladder-crawler/plagger/ fastladder-crawler
Plaggerのディレクトリにエイリアスを作成。
$ ln -s fastladder-crawler/lib/Plagger/Plugin/Store/ ~/Sites/plagger/cpan/lib/perl5/site_perl/Plagger/Plugin/Store
fastladder-crawler.yaml を作成。
global:
timezone: Asia/Tokyo
log:
level: debug
plugins:
- module: Subscription::Config
config:
feed:
- url: http://b.hatena.ne.jp/retlet/atomfeed
- module: Store::Fastladder
config:
connect_info:
- dbi:mysql:fastladder_production
- root
- on_connect_do:
- SET NAMES utf8
member_id: 1
Plaggerでクローラーを動かす
Plagger実行。
$ cd ~/Sites/plagger
$ bin/plagger -c fastladder-crawler.yaml
Plagger [info] plugin Plagger::Plugin::Subscription::Config loaded.
Base class package "DBIx::Class::Schema::Loader" is empty.
(Perhaps you need to 'use' the module which defines that package first.)
at /Users/Madhat/Sites/plagger/cpan/lib/perl5/site_perl/Plagger/Plugin/Store/Fastladder/Schema/Loader.pm line 10
BEGIN failed--compilation aborted at /Users/Madhat/Sites/plagger/cpan/lib/perl5/site_perl/Plagger/Plugin/Store/Fastladder/Schema/Loader.pm line 10, <DATA> line 1.
Compilation failed in require at /Users/Madhat/Sites/plagger/cpan/lib/perl5/site_perl/Plagger/Plugin/Store/Fastladder.pm line 11, <DATA> line 1.
BEGIN failed--compilation aborted at /Users/Madhat/Sites/plagger/cpan/lib/perl5/site_perl/Plagger/Plugin/Store/Fastladder.pm line 11, <DATA> line 1.
Compilation failed in require at /Users/Madhat/Sites/plagger/cpan/lib/perl5/site_perl/Plagger.pm line 232, <DATA> line 1.
><
$ sudo cpan -i DBIx::Class::Schema::Loader
...
/usr/bin/make install -- OK
質問は全部Enter連打した。
って、やっぱり同じエラー出る。なんぞ。
とりあえずPlaggerが古いので最新版にしてみる。
$ cd ../plagger
$ svn co http://svn.bulknews.net/repos/plagger/trunk/plagger
$ cd plagger/
$ perl Makefile.PL
Can't locate inc/Module/Install.pm in @INC...
モジュール足りないので入れる。
$ sudo cpan -i inc::Module::Install
...[Enter]連打
どうや。
$ perl Makefile.PL
include /Users/Madhat/Sites/plagger/plagger/inc/Module/Install.pm
Bareword "use_test_base" not allowed while "strict subs" in use at Makefile.PL line 114.
Execution of Makefile.PL aborted due to compilation errors.
むむ。PlaggerFAQ - Plagger - Trac見ると、YAMLとModule::InstallとTest::Baseを入れろとあった。
$ sudo cpan -i YAML
$ sudo cpan -i Module::Install
$ sudo cpan -i Test::Base
で今度こそ。
$ perl Makefile.PL
...[Enter]連打
Writing Makefile for Plagger
できた。makeする。
$ sudo make
$ sudo make test
...
3 tests skipped.
Failed 210/214 test scripts, 1.87% okay. 4/263 subtests failed, 98.48% okay.
make: *** [test_dynamic] Error 2
うわーん。
Can't locate XML/Atom.pm in @INC
が目についたので入れてみる。
$ sudo cpan -i XML::Atom
...
Failed 3/20 test scripts, 85.00% okay. 3/278 subtests failed, 98.92% okay.
make: *** [test_dynamic] Error 255
/usr/bin/make test -- NOT OK
Running make install
make test had returned bad status, won't install without force
うーん。こういうときはどの辺を見れば原因がわかるのかな。
無理矢理やってしまおう。
$ sudo cpan
cpan[1]> force install XML::Feed
(cpan> test Plaggerして不足モジュールをチェックしたところ、XML::Feedも足りなかったのでXML::Feedから入れた。XML::Atomも一緒に入ったので次のステップへ)
make testしようと思ったけど、ssig33に「testなんか気にすんな」と言われたので気にせずインストール。
$ sudo make install
...
Writing /opt/local/lib/perl5/site_perl/5.8.8/darwin-2level/auto/Plagger/.packlist
Appending installation info to /opt/local/lib/perl5/5.8.8/darwin-2level/perllocal.pod
成功っぽい。
$ plagger -c ../fastladder-crawler.yaml
...
Plagger [info] plugin Plagger::Plugin::Subscription::Config loaded.
Can't locate Plagger/Plugin/Store/Fastladder.pm in @INC (@INC contains: /opt/local/bin/lib /sw/lib/perl5 /sw/lib/perl5/darwin /opt/local/lib/perl5/5.8.8/darwin-2level /opt/local/lib/perl5/5.8.8 /opt/local/lib/perl5/site_perl/5.8.8/darwin-2level /opt/local/lib/perl5/site_perl/5.8.8 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl/5.8.8/darwin-2level /opt/local/lib/perl5/vendor_perl/5.8.8 /opt/local/lib/perl5/vendor_perl .) at /opt/local/lib/perl5/site_perl/5.8.8/Plagger.pm line 234, <DATA> line 1.
エイリアス作るの忘れてたのでコピーしてもう一度。
$ ln -s fastladder-crawler/lib/Plagger/Plugin/Store/ ~/Sites/plagger/plagger/lib/Plugin/Store
$ plagger -c ../fastladder-crawler.yaml
Plagger [info] plugin Plagger::Plugin::Subscription::Config loaded.
...
同じエラー。よく見たらパスが通ってない。
$ vim ~/.bashrc
...
export PERL5LIB=~/Sites/plagger/plagger/lib/
...
$ source ~/.bashrc
$ plagger -c ../fastladder-crawler.yaml
Plagger [info] plugin Plagger::Plugin::Subscription::Config loaded.
Plagger [info] plugin Plagger::Plugin::Store::Fastladder loaded.
DBIx::Class::Storage::DBI::datetime_parser(): Couldn't load DateTime::Format::MySQL: Can't locate DateTime/Format/MySQL.pm in @INC (@INC contains: /opt/local/bin/lib /Users/Madhat/Sites/plagger/plagger/lib /opt/local/lib/perl5/5.8.8/darwin-2level /opt/local/lib/perl5/5.8.8 /opt/local/lib/perl5/site_perl/5.8.8/darwin-2level /opt/local/lib/perl5/site_perl/5.8.8 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl/5.8.8/darwin-2level /opt/local/lib/perl5/vendor_perl/5.8.8 /opt/local/lib/perl5/vendor_perl .) at (eval 1048) line 2, <DATA> line 1.
BEGIN failed--compilation aborted at (eval 1048) line 2, <DATA> line 1.
一歩前進。
モジュール入れる。
$ sudo cpan -i DateTime::Format::MySQL
こーれーでーどーだー。
$ plagger -c ../fastladder-crawler.yaml
Plagger [info] plugin Plagger::Plugin::Subscription::Config loaded.
Plagger [info] plugin Plagger::Plugin::Store::Fastladder loaded.
Plagger [info] plugin Plagger::Plugin::Bundle::Defaults loaded.
Plagger [info] plugin Plagger::Plugin::Aggregator::Simple loaded.
Plagger [info] plugin Plagger::Plugin::Summary::Auto loaded.
Plagger [info] plugin Plagger::Plugin::Summary::Simple loaded.
Plagger [info] plugin Plagger::Plugin::Namespace::HatenaFotolife loaded.
Plagger [info] plugin Plagger::Plugin::Namespace::MediaRSS loaded.
Plagger [info] plugin Plagger::Plugin::Namespace::ApplePhotocast loaded.
Plagger::Plugin::Aggregator::Simple [info] Fetch http://b.hatena.ne.jp/retlet/atomfeed
Plagger::Cache [debug] Cache MISS: Aggregator-Simple|http://b.hatena.ne.jp/retlet/atomfeed
Plagger::Plugin::Aggregator::Simple [debug] 200: http://b.hatena.ne.jp/retlet/atomfeed
Plagger::Plugin::Aggregator::Simple [info] Aggregate http://b.hatena.ne.jp/retlet/atomfeed success: 30 entries.
できたー!!
おめでとうございます。ありがとうございます。
トラックバック(1)
トラックバックURL: http://retlet.net/cgi-bin/mt5/mt-tb.cgi/23
何日か前から,Twitterで「Plaggerいじりたい」を連呼していた僕ですが,昨日やっと手をつけられました. 自宅サーバにUbuntu... 続きを読む
I was checking the internet for some information since yesterday night and I at long last found this! This is a good webpage by the way, but it looks a little difficult to read from my android phone.
This is a attention-grabbing post by the way. I am going to go ahead and bookmark this post for my sister to read later on tonight. Keep up the superior work.
This is a attention-grabbing post by the way. I am going to go ahead and bookmark this post for my sis to read later on tonight. Keep up the fine work.
I was searching on line for some information since yesterday night and I at last found this! This is a great weblog by the way, but it looks a slight difficult to read in my i phone.
I had this website bookmarked a while ago but my laptop crashed. I have since gotten a new one and it took me a while to come across this! I also really like the template though.
My brother bookmarked this site for me and I have been going through it for the past several hours. This is really going to help me and my friends for our class project. By the way, I enjoy the way you write.
This is some agreeable stuff. It took me a while to locate this website but it was worth the time. I noticed this post was buried in yahoo and not the number one spot. This site has a lot of fine material and it does not deserve to be burried in the search engines like that. By the way I'm going to add this web page to my list of favorites.
I was researching through the internet for some info since yesterday night and I at long last found what i was looking for! This is a magnificent webpage by the way, although it seems a little hard to navigate in my smart phone.
I had this page bookmarked a while previously but my computer crashed. I have since gotten a new one and it took me a while to find this! I also really like the design though.
I’m often to blogging and i in truth respect your content. The editorial has actually peaks my interest. I’m going to bookmark your post and preserve checking for brand new information.
This is the perfect blog for anyone who wants to know about this topic. You know so much its almost hard to argue with you (not that I in fact would want…HaHa). You positively put a new spin on a subject thats been written about for years. great stuff, just huge!
Hi, high-quality post. I have been pondering this topic, so thank you for sharing. I’ll likely be arrival back to your posts. Keep up the fine work
This is a fascinating article by the way. I am going to go ahead and bookmark this post for my sis to read later on tomorrow. Keep up the first-rate work.
Just to let you know, this page looks a little bit weird from my smart phone. Who knows maybe it is just my phone. Great article by the way.
That is my third time visiting this web site. We are beginning a new initiative in the same class as this web publication. Your web page provided us with beneficial information to work on. You’ve gotten performed a admirable job. The rationale why i like this put up and it is so informational and I’m gonna save it. One thing to say the Indepth analysis this piece has is vastly remarkable.Nobody goes that further mile these days? Well Executed!!!
I really enjoy this template you've got going on on your site. What is the name of the theme by the way? I was thinking of using this style for the blog I am going to construct for my class room project.
This is such a terrific resource that you are providing and you give it away for free. I love seeing web sites that understand the value of providing a quality resource for free. It?s the old what goes around comes around routine. Yours truly.
I am going to go ahead and save this article for my sister for a coming up study project for school. This is a attractive website by the way. Where do you obtain the theme for this website?
Pretty first-class post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.
I really enjoy this template you've got going on on your blog. What is the name of the design by the way? I was thinking of using this style for the website I am going to build for my class project.
Stumbled into this article by chance but I’m sure glad I clicked on that link. You positively answered all the questions I’ve been dying to answer for some time now. Will without doubt come back for more of this. Thank you so much
This is a excellent piece, I found your weblog browsing internet for a related theme and came to this. I couldnt come across to much added information on this piece, so it was pleasing to find this one. I will certainly end up being back again to check out some other posts that you have another time.
I had this page saved some time ago but my laptop crashed. I have since gotten a new one and it took me a while to find this! I also really like the design though.
Once again, it is easy to see why this is one of the finest websites on the entire web, keep pumping out the huge content!
This is some beneficial material. It took me some time to come across this internet site but it was worth the time. I noticed this content was buried in bing and not the number one spot. This web site has a lot of first-class stuff and it doesn't deserve to be burried in the searches like that. By the way I am going to save this web publication to my favorites.
The way you write make it really trouble-free to read. And the template you use, wow. It really is a really good combination. And I am wondering what is the name of the theme you use?
Hey man, was just looking through the net looking for some info and came across your post. I am impressed by the info that you have on this blogsite. It shows how well you understand this topic. bookmarked this page, will come back for more. You, my friend, ROCK!!!
I was exploring on line for some info since yesterday night and I finally found this! This is a fantastic web site by the way, although it is a little difficult to read in my smart phone.
I really enjoy this design you've got going on in your internet site. What is the name of the theme by the way? I was thinking of using this style for the web page I am going to make for my class room project.
This is a appealing post by the way. I am going to go ahead and save this post for my sister to check out later on tonight. Keep up the high-quality work.
I wished to say that it’s wonderful to know that someone else also pointed out this as I had trouble finding the same info somewhere else. This was the first place that told me the answer. Appreciate it. My kindest regards.
The style that you write make it truly straightforward to read. And the template you use, wow. It really is a really good combination. And I am wondering what's the name of the template you use?
This in truth is my very first time i go to here. I found so plentiful entertaining stuff in your web publication, particularly its argument. In the tons of testimonials in your reports, I guess I’m not the only 1 acquiring all the leisure here! Keep up the superb work.
The style that you write make it really easy to read. And the template you use, wow. Its a really good combination. And I am wondering what's the name of the design you use?
The way you write make it truly simple to read. And the design you use, wow. It really is a really decent combination. And I am wondering what's the name of the template you use?
Thank you for the sensible critique. Me & my neighbour were preparing to do some research about that. We got a high-quality book on that matter from our local library and most books where not as influensive as your information. I am very glad to see such information which I was searching for a long time.This made very glad
This is some nice material. It took me a while to locate this site but it was worth the time. I noticed this post was buried in google and not the first spot. This weblog has a ton of pleasant material and it does not deserve to be burried in the search engines like that. By the way I'm going to save this web site to my list of favorites.
Thank you so much for this brilliant web page;this is the kind of thing that keeps me awake through the day. I’ve been looking around for this content after I heard about them from a buddy and was thrilled when I found it after searching for awhile. Being a avid blogger, I’m dazzled to see others taking initivative and contributing to the community. Just wanted to comment to show my appreciation for your blog as it is very worthy of note, and many bloggers do not get credit they deserve. I am sure I’ll drop by again and will send some of my friends.
I was browsing the internet for some info since yesterday night and I at long last found what i was looking for! This is a great blog by the way, except it seems to be a little difficult to read from my tmobile phone.
Pretty excellent post. I just stumbled upon your webpage and wanted to say that I have in fact enjoyed reading your internet site posts. Any way I’ll be subscribing to your feed and I hope you post again soon.
I really enjoy this design you have got going on in your web site. What is the name of the theme by the way? I was thinking of using this style for the website I am going to build for my school project.
This is a very good piece, I found your weblog browsing internet for a related theme and came to this. I couldnt come across to much further information on this piece, so it was pleasing to locate this one. I will certainly end up being back again to check out some other posts that you have another time.
I am going to go ahead and save this page for my sis for a research project for class. This is a appealing web site by the way. Where do you obtain the template for this webpage?
Appreciate writing this. I love the online world because you can study something new every day. I’ll share this with my friends, thank you!
This is a fascinating post by the way. I am going to go ahead and save this post for my brother to read later on tonight. Keep up the first-rate work.
I was searching using the web for some info since yesterday night and I finally found what i was looking for! This is a terrific webpage by the way, although it appears a little difficult to read from my i phone.
This is a remarkable post by the way. I am going to go ahead and bookmark this article for my brother to check out later on tomorrow. Keep up the fine work.
This is a appealing post by the way. I am going to go ahead and save this post for my sister to check out later on tomorrow. Keep up the good work.
This is some high-quality stuff. It took me some time to find this site but it was worth the time. I noticed this page was hidden in bing and not the first spot. This internet site has a ton of first-rate stuff and it doesn't deserve to be burried in the search engines like that. By the way I am going to add this web site to my list of favorites.
Very informative post. Thank you for taking the time to share your view with us.