« 04.10 れっつ夜桜 五月山 | ココ | 04.14 Rails 2.3から知恵を拝借 »

2009年4月12日

Rails 2.3が動かず苦悩   このエントリーを含むはてなブックマーク 

実験的にいろいろ触っているRailsプロジェクトは、VirtualHostではなくサブディレクトリ下で動かしているのでmongrel_clusterで起動させてるんやけど、このほどRails2.3にバージョンアップさせたところさっぱり起動しなくなった。同じサーバーで動かしてるRedmineは、2.2系を使うように指定してあったお陰か問題なく起動するんだが。

** Mounting Rails at /prefix...
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant ActionController::AbstractRequest (NameError)
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:151:in `rails'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:113:in `cloaker_'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `call'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `listener'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:99:in `cloaker_'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `call'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `new'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `run'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
from /usr/bin/mongrel_rails:16:in `load'
from /usr/bin/mongrel_rails:16

ActionController::AbstractRequestがどうやらない、ということでGoogle先生に聞いてみたところ、2.3では存在していないことは分かったものの、代わりにどう書けばいいのかが出てこない。そこ肝心なんですけど。

Metal(Rack)+Lighttpd+FCGI でいろいろハマる -- 落とし穴3 relative_url_root のこと (ref. みじんこ日記)

config/environments/production.rb にActionController::Base.relative_url_rootにprefixの中身を書いて、代わりにmongrel_cluster.ymlのprefixをなくせばいいのね。無事解決おめでとう。

$ vi config/environments/production.rb

# Settings specified here will take precedence over those in config/environment.rb

ActionController::Base.relative_url_root = '/prefix'

By ただ at 23:38 カテゴリー ; PinMarch Samples , プログラミングとか

« 04.10 れっつ夜桜 五月山 | 04月の記事 | 04.14 Rails 2.3から知恵を拝借 »




トラックバック

このエントリーのトラックバックURL:
http://pinmarch.sakura.ne.jp/mt/mt-tb.cgi/1399

このリストは、次のエントリーを参照しています: Rails 2.3が動かず苦悩:

» パトリック スニーカー メンズ from パトリック スニーカー メンズ
European design meets all American girlthat's a fabulous combination i not ab...

トラックバック時刻: 2014年11月11日 08:17

» Rails 2.3 on Mongrel + apache de prefix from PinMarch
prefixを付けてrailsプロジェクトを実行したいというのは、1つのサーバー...

トラックバック時刻: 2009年5月14日 07:39