2008年3月7日金曜日

《Rails postgres-pr-0.4.0 バグ》

x86_64環境での postgres-pr-0.4.0がなぜかエラーでこける。。

cannot read beyond the end of buffer

/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/buffer.rb:47:in `read'
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/message.rb:284:in `parse'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in `collect'
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/message.rb:279:in `parse'
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/message.rb:67:in `parse'
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/message.rb:277:in `parse'

調べたところ、rubyforgeのトラッカーに次のようなバグを発見した。

https://rubyforge.org/tracker/index.php?func=detail&aid=3725&group_id=234&atid=967

結論は、x86_64の環境でpostgres-pr-0.4.0の"buffer.rb:47:in `read'"にバグがあり実行できないようだ。。(はまった)

postgresへのアクセスをruby-postgresに変更することにした。

http://ruby.scripting.ca/postgres/

yum -y install postgresql-devel wget http://ruby.scripting.ca/postgres/archive/ruby-postgres-0.7.1.tar.gz tar xzvf ruby-postgres-0.7.1.tar.gz ruby extconf.rb --with-pgsql-include-dir=<include file directory> \--with-pgsql-lib-dir=<library directory> make su make install

postgres-pr-0.4.0をイントールしたままでも、ruby-postgresで優先的にアクセスされるようだ。

0 件のコメント: