2011/06/12

Rails3でwill_pagenateを使う

will_paginate 3.0.preだと下記のエラーが出るので3.0pre2を使う
DEPRECATION WARNING: railtie_name is deprecated and has no effect. 

Gemfileこんな感じで記入して後はbundle install
#gem 'will_paginate', '3.0.pre'
gem 'will_paginate', '3.0.pre2'

apacheの負荷テスト

ab [options] URL

でできる。
ServerLimit 及び MaxClients の設定の参考に。
参考:
http://www.atmarkit.co.jp/flinux/rensai/apache15/apache15b.html

apacheのエラー修正

PHP Warning:  PHP Startup: apc: Unable to initialize module\nModule 
compiled with module API=20050922, debug=0, thread-safety=0\nPHP
compiled with module API=20060613, debug=0, thread-safety=0\nThese 
options need to match\n in Unknown on line 0

こいつはhttp://forums.fedoraforum.org/archive/index.php/t-157117.htmlを参考に
yum install php-pear httpd-devel php-devel
pecl uninstall apc
pecl install apc
で対応

もう一つこっちは直したと思ったんだけど。libxml2を入れたけどlibxsltを入れたなかったのが原因っぽいので再度対応。参考:http://doruby.kbmj.com/tn_on_rails/20110311/CentOS_5.5_Nokogiri_
WARNING: Nokogiri was built against LibXML version 2.7.8, but has dynamically loaded 2.6.26

http://d.hatena.ne.jp/kitamomonga/20100223/ruby_nokogiri_install_with_any_libxml2_pathを参考にソースを入れてる適当なディレクトリに移動してから下記を実行。

tar xzvf LATEST_LIBXSLT
cd libxslt-1.1.26/
./configure --prefix=$HOME/usr/local --with-libxml-src=../libxml2-2.7.7
make
make install

em install nokogiri -- --with-xml2-include=$HOME/usr/local/include/libxml2 --with-xml2-lib=$HOME/usr/local/lib --with-xslt-dir=$HOME/usr/local

んでapacheを再起動。

mysqlのエラー修正

エラーの修正
[Warning] '--default-character-set' is deprecated 
and will be removed in a future release. 
Please use '--character-set-server' instead.
をはいていたのでmy.confを修正
[mysqld]
#default-character-set = utf8
character-set-server = utf8

もう一つのエラー
Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
110612 14:43:49  InnoDB: Started; log sequence number 0 44446294

こっちは下記で修正
mysql_upgrade -u root -p

mysqlを再起動。