Xavier Noria
2006-Jul-26 16:43 UTC
[Rails] lesson learned: script/runner does not abort on failed require
After a fresh installation of an application, some utility scripts run with script/runner quietly aborted right after their start. No error message whatsoever, just a new shell prompt. The reason was an uninstalled dependecy, but that was difficult to determine because the load failure was not reported: % ruby script/runner ''require "foobarbaz"'' % Why that does not raise an excepcion? command/runner.rb evals ARGV.first and eval does raise LoadError: irb(main):002:0> eval(''require "foobarbaz"'') LoadError: (eval):1:in `require'': no such file to load -- foobarbaz Is there any magic in Rails that has that side effect? -- fxn
Xavier Noria
2006-Jul-26 17:00 UTC
[Rails] lesson learned: script/runner does not abort on failed require
After a fresh installation of an application, some utility scripts run with script/runner quietly aborted right after their start. No error message whatsoever, just a new shell prompt. The reason was an uninstalled dependecy, but that was difficult to determine because the load failure was not reported: % ruby script/runner ''require "foobarbaz"'' % Why that does not raise an excepcion? command/runner.rb evals ARGV.first and eval does raise LoadError: irb(main):002:0> eval(''require "foobarbaz"'') LoadError: (eval):1:in `require'': no such file to load -- foobarbaz Is there any magic in Rails that has that side effect? -- fxn