query: tag:rack

thinを使ってmerbアプリケーションをrackupする方法のメモです。
以下のようなconfig.ruファイルを用意します。

ruby>>

config.ru

require 'rubygems'
require 'merb-core'Merb::Config.setup(
:merb_root => File.expand_path(File.dirname(FILE)),
:environment => ENV['RACK_ENV'])
Merb.environment = Merb::Config[:environment]
Merb.root = Merb::Config[:merb_root]
Merb::BootLoader.run

use Merb::Rack::Static, Merb.dir_for(:public)
run Merb::Rack::Application.new
<<--

あとは、以下のようなコマンドで起動します。

pre>>
% RACK_ENV=development thin -R config.ru start
<<--

posted by genki genki on Thu 19 Feb 2009 at 02:47 with 0 comments

I am using merb with passenger on our production server.
The passenger is going well in most of cases.
But if dependent gems have been updated, it becomes acting up when it got restarted.
After I encountered such situations several times, I decided to begin investigation about the issue.

Detail of the issue is as follows.

  • My merb app becomes causing errors after restarting of passenger by "touch tmp/restart.txt" if dependency gems were updated and they have no compatibility.
  • Even if the gems were compatible, my merb app kept using old gems until apache is reloaded.
  • pids were changing successfully while restarting.
  • /etc/init.d/apache reload can refresh everything as expected.
  • "touch tmp/restart.txt" can't.

I wonder there is the master of master processes which keeps LOAD_PATH and it is refusing to use new gems.
I am thinking I should investigate the Rack.

Update

Finally, the issue was solved!

The solution is found here

posted by takiuchi takiuchi on Sat 17 Jan 2009 at 22:41 with 0 comments