失敗した。
なんの気無しにCygwinの各種パッケージのアップデートを行った。すると、今までRubyは1.8系だったのが(遂に!)1.9系へ。そういえばCygwinのMLでアナウンスされてたなと喜んだのも束の間、トラブルが発生。
先ず、元々RubyGemsで入れていた各種パッケージが使えなくなった。まぁこれは恐らく、rubyのバージョンが変わった所為だろう。インストール先のパスにバージョンナンバーが入っているのは確認出来たし。という訳でgem install(とかbundle install)。これは特に問題なし(ディスク上に1.8系で使ってたパッケージのファイルがまるまる残されてそうだが)。
問題は次。Herokuにデプロイするアプリケーションを開発する為に使っているforemanがまともに動かなくなった。
foreman start
すると、
23:38:04 web.1 | started with pid 4376
……と出力したところで止まる。プロセスがゾンビ化し、Ctrl+Cも効かない。
Procfileに書いている内容を元に、
bundle exec ruby script.rb -p 5000
とプロンプトに入れてみると、これは普通に動作する(WEBrickで起動する)。
そういえばrubyにはdebug用のオプションが在ったなと、ruby -d `which foreman` start
してみると、以下の出力が得られた。
Exception `LoadError' at /usr/lib/ruby/1.9.1/rubygems.rb:1264 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /usr/lib/ruby/1.9.1/rubygems.rb:1273 - cannot load such file -- rubygems/defaults/ruby
/usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/engine.rb:103: warning: assigned but unused variable - process
/usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/engine.rb:103: warning: assigned but unused variable - index
/usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/env.rb:21: warning: method redefined; discarding old entries
/usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export.rb:14: warning: assigned but unused variable - formatter
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36: warning: loading in progress, circular require considered harmful - /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export.rb
from /usr/bin/foreman:23:in `<main>'
from /usr/bin/foreman:23:in `load'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/bin/foreman:5:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/cli.rb:5:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export.rb:28:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export/base.rb:1:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36: warning: loading in progress, circular require considered harmful - /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export.rb
from /usr/bin/foreman:23:in `<main>'
from /usr/bin/foreman:23:in `load'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/bin/foreman:5:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/cli.rb:5:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export.rb:29:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export/inittab.rb:1:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export/upstart.rb:20: warning: assigned but unused variable - port
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36: warning: loading in progress, circular require considered harmful - /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export.rb
from /usr/bin/foreman:23:in `<main>'
from /usr/bin/foreman:23:in `load'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/bin/foreman:5:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/cli.rb:5:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export.rb:30:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export/upstart.rb:2:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36: warning: loading in progress, circular require considered harmful - /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export.rb
from /usr/bin/foreman:23:in `<main>'
from /usr/bin/foreman:23:in `load'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/bin/foreman:5:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/cli.rb:5:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export.rb:31:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export/bluepill.rb:2:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36: warning: loading in progress, circular require considered harmful - /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export.rb
from /usr/bin/foreman:23:in `<main>'
from /usr/bin/foreman:23:in `load'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/bin/foreman:5:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/cli.rb:5:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export.rb:32:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export/runit.rb:2:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36: warning: loading in progress, circular require considered harmful - /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export.rb
from /usr/bin/foreman:23:in `<main>'
from /usr/bin/foreman:23:in `load'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/bin/foreman:5:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/cli.rb:5:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export.rb:33:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export/supervisord.rb:2:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36: warning: loading in progress, circular require considered harmful - /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export.rb
from /usr/bin/foreman:23:in `<main>'
from /usr/bin/foreman:23:in `load'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/bin/foreman:5:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/cli.rb:5:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export.rb:34:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/foreman-0.57.0/lib/foreman/export/launchd.rb:2:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
Exception `NameError' at /usr/lib/ruby/1.9.1/psych/core_ext.rb:16 - method `to_yaml' not defined in Object
Exception `NameError' at /usr/lib/ruby/1.9.1/psych/core_ext.rb:29 - method `yaml_as' not defined in Module
Exception `NameError' at /usr/lib/ruby/1.9.1/psych/deprecated.rb:79 - undefined method `to_yaml_properties' for class `Object'
/usr/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/base.rb:583: warning: instance variable @no_tasks not initialized
/usr/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor.rb:294: warning: instance variable @long_desc not initialized
/usr/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor.rb:294: warning: instance variable @long_desc not initialized
03:59:38 web.1 | started with pid 3760
最初に出てくる2つのLoadError
が気になる……/usr/lib/ruby/1.9.1/rubygems/defaults/なんてディレクトリは無いし。
うーん、どうすれば良いんだろう?誰か解決策知ってる人居ませんかね?
- Procfileに書いている内容
web: bundle exec ruby script.rb -p $PORT