月別アーカイブ: 6月 2007

ruby1.8.6と1.8.5で微妙に違うのでハマった。

app/controllers/demo_controller.rb

app/controllers/demo/test_controller.rb

app/controllers/demo/hoge_controller.rb

で、クラスが、

class DemoController < …

class Demo::TestController <…

class Demo::HogeController <…

この場合、期待されるのが、

http://localhost/demo/show/1

http://localhost/demo/test/new

http://localhost/demo/test/list

http://localhost/demo/hoge/edit/20

こんな感じなんだけど、1.8.5の場合これがうまくいかない。

demoコントローラーのtestアクションでnewってidが入ってしまうのです。

demo/testコントローラーのnewアクションを期待してたのに。。。

1.8.6だと期待通り。

とりあえずdemo_controller.rbの名前をdemos_controller.rbとかにかえるかdemoディレクトリをdmとか変えれば大丈夫。

class DemosController < …..

class Dm::TestController < …

いいのかな?

update テーブル名 set カラム名 = replace(カラム名,’置換対象文字列’,'置換後文字列’);

div{
word-wrap: break-word;
word-break: break-all;
}

http://www.apsis.ch/pound/

./configure
make
make install

たしか/etc/init.d/poundができるはず。

service pound start
service pound stop

config

ListenHTTP
Address 192.168.1.250
Port    80
xHTTP   2

Service
HeadRequire “Host: test.twintail.tv”
BackEnd
Address 127.0.0.1
Port    3000
End
End

Service
HeadRequire “Host: test2.twintail.tv”
BackEnd
Address 127.0.0.1
Port    3001
End
BackEnd
Address 127.0.0.1
Port    3002
End
End

Service
BackEnd
Address 127.0.0.1
Port    8080
End
End
End

grep -lr hoge * | grep -v ‘.svn/’ | xargs sed -i ’s/hoge/HOGE/g’

up2date -p

up2date -u

up2date –show-available

up2date –install hogehoge

script/plugin install http://svn.rails-engines.org/plugins/engines

まだ途中。

rake rails:freeze:gems

user@myserv% sudo mongrel_rails cluster::configure ?
-e production -p 8100 -a 127.0.0.1 -l /var/log/mongrel.log ?
-P /var/run/mongrel/mongrel.pid -c /var/www/rails.example.jp ?
-r /var/www/rails.example.jp -N 3 –user www-data –password www-data

cd RAILS_ROOT
mongrel_rails cluster::config -e production -p 8000 -N 3
mongrel_rails cluster::start
mongrel_rails cluster::stop

rake environment RAILS_ENV=production migrate