From: eiichi_maekawa@... Date: 2010-03-26T10:14:50+09:00 Subject: [ruby-list:46956] Re: sinatraについて;【ruby-list:46954】 Soraさん、5.5さん ありがとうございました。 プログラムで止めるのではなく、コマンドレベルで、なんとか止められないものか と・・・ まだ、sinatraも、テストで動かしただけなので、今からの勉強です。 Soraさんからいただいたコメント >追記です。 > >まず、提示したurlのgistページは「Sinatraの終了」に関するページではなく、 >spawnとfork」に関するページです。 > >また、その文書の著者による追記があります。以下のURLを参照なさると問題が解 決できると思います。 > >http://ujihisa.blogspot.com/2010/03/atexit-is-not-reliable.html >2010/3/25 Sora Harakami : 5.5さん、thinをインストール試みましたが、上手くできませんでした。ご教示いた だけませんか。 宜しくお願いします。 "5.5" <5.5@moji.gr.jp> wrote on 2010/03/25 22:13:18: > > gem の一覧を見ると,thin はインストールされていないのですね。 > なのでサーバーは Mongrel で動いているのだと思います。    ご指摘の通りです。インストールしたのもググって、実行し、その中で    Mongrelを使うとの記載がありました。 > > よく分からないのですが,mswin32 版で,Mongrel でサーバーを書 > くと,Ctrl+C を押しても止まらないみたいです。 > これは Sinatra に限りません。 > Ctrl+C を押したあとでブラウザーでリロードしようとするとよう > やく止まります。 > > thin だと Ctrl+C ですぐ止まります。 > > thin をインストールしておくと Sinatra は thin を使います。 > > 前川さんのおっしゃっている「止められない」が上記と同じことな > のかどうか分かりませんが,もしそうであれば > gem install thin > してから Sinatra アプリを動かしてみられてはどうでしょうか。 > 5.5さん、thinのインストール試みましたが、結果は、以下となりました。 対処方法について、ご教示いただければありがたいです。 会社のパソコンを使用しているため、ローカルでインストールしています。 sinatraのようにローカルでインストールしようとしたのですが、 エラーで、インストールできませんでした。 (今まで、エラーで、インストールに失敗したことはありませんでした。) DOSコマンドでの実行結果、以下です。 D:\Ruby>gem install thin-1.2.4-x86-mswin32 --local ERROR: Error installing thin-1.2.4-x86-mswin32: thin requires eventmachine (>= 0.12.6, runtime) となったので、eventmachine をダウンロードして、実行 D:\Ruby>gem install eventmachine-0.12.6.gem --local Building native extensions. This could take a while... ERROR: Error installing eventmachine-0.12.6.gem: ERROR: Failed to build gem native extension. D:/Ruby/bin/ruby.exe extconf.rb checking for rb_trap_immediate in ruby.h,rubysig.h... no checking for rb_thread_blocking_region()... no checking for windows.h... no could not find header: windows.h *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --srcdir=. --curdir --ruby=D:/Ruby/bin/ruby Gem files will remain installed in D:/Ruby/lib/ruby/gems/1.8/gems/eventmachine-0.12.6 for inspection. Results logged to D:/Ruby/lib/ruby/gems/1.8/gems/eventmachine-0.12.6/ext/gem_make.out と、エラーが出ました。 make.outを確認すると D:/Ruby/bin/ruby.exe extconf.rb checking for rb_trap_immediate in ruby.h,rubysig.h... no checking for rb_thread_blocking_region()... no checking for windows.h... no could not find header: windows.h *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --srcdir=. --curdir --ruby=D:/Ruby/bin/ruby mkmf.logは、D:\Ruby\lib\ruby\gems\1.8\gems\eventmachine-0.12.6\ext に存在しています。 内容は、 have_var: checking for rb_trap_immediate in ruby.h,rubysig.h... -------------------- no "cl -nologo -I. -ID:/Ruby/lib/ruby/1.8/i386-mswin32 -I. -MD -Zi -O2b2xg- -G6 -c conftest.c" checked program was: /* begin */ 1: #define WIN32_LEAN_AND_MEAN 2: #define WIN32 3: #include 4: #include 5: #include 6: #include 7: #include 8: 9: /*top*/ 10: int main() { return 0; } 11: int t() { const volatile void *volatile p; p = &(&rb_trap_immediate)[0]; return 0; } /* end */ -------------------- have_func: checking for rb_thread_blocking_region()... -------------------- no "cl -nologo -Feconftest -I. -ID:/Ruby/lib/ruby/1.8/i386-mswin32 -I. -ID:/Ruby/lib/ruby/1.8/i386-mswin32 -MD -Zi -O2b2xg- -G6 conftest.c msvcrt-ruby18-static.lib oldnames.lib user32.lib advapi32.lib shell32.lib ws2_32.lib -link -libpath:"." -libpath:"D:/Ruby/lib" " checked program was: /* begin */ 1: #define WIN32_LEAN_AND_MEAN 2: #define WIN32 3: #include 4: #include 5: #include 6: 7: /*top*/ 8: int main() { return 0; } 9: int t() { void ((*volatile p)()); p = (void ((*)()))rb_thread_blocking_region; return 0; } /* end */ "cl -nologo -Feconftest -I. -ID:/Ruby/lib/ruby/1.8/i386-mswin32 -I. -ID:/Ruby/lib/ruby/1.8/i386-mswin32 -MD -Zi -O2b2xg- -G6 conftest.c msvcrt-ruby18-static.lib oldnames.lib user32.lib advapi32.lib shell32.lib ws2_32.lib -link -libpath:"." -libpath:"D:/Ruby/lib" " checked program was: /* begin */ 1: /*top*/ 2: int main() { return 0; } 3: int t() { rb_thread_blocking_region(); return 0; } /* end */ -------------------- have_header: checking for windows.h... -------------------- no "cl -nologo -E -I. -ID:/Ruby/lib/ruby/1.8/i386-mswin32 -I. -MD -Zi -O2b2xg- -G6 conftest.c -P" checked program was: /* begin */ 1: #include /* end */ -------------------- となっていました。 どうすれば、eventmachineがローカルでインストール出来るでしょうか? gem list --local で確認しても、eventmachineは、表示されませんでした(当然で すよね) 冗長になりましたが、宜しくお願いします。 了