这个命令是我的问题:
/usr/local/bin/ruby **script/runner** --environment=production app/jobs/**my_job.rb** -t my_arg
`my_job.rb` is my script, which handles command line arguments. In this case it is `-t my_arg`.
my_job.rb
也以 `--environment=production' 作为参数,应该是脚本/运行器的参数。
我想这可以使用一些括号来解决,但没有任何想法。
如果解决方案不涉及(或依赖于)Rails 或 Linux 的全局环境,那就更好了。
/usr/local/lib/ruby/1.8/optparse.rb:1450:in `complete': invalid option: --environment=production (OptionParser::InvalidOption)
from /usr/local/lib/ruby/1.8/optparse.rb:1448:in `catch'
from /usr/local/lib/ruby/1.8/optparse.rb:1448:in `complete'
from /usr/local/lib/ruby/1.8/optparse.rb:1261:in `parse_in_order'
from /usr/local/lib/ruby/1.8/optparse.rb:1254:in `catch'
from /usr/local/lib/ruby/1.8/optparse.rb:1254:in `parse_in_order'
from /usr/local/lib/ruby/1.8/optparse.rb:1248:in `order!'
from /usr/local/lib/ruby/1.8/optparse.rb:1339:in `permute!'
from /usr/local/lib/ruby/1.8/optparse.rb:1360:in `parse!'
from app/jobs/2new_error_log_rt_report.rb:12:in `execute'
from app/jobs/2new_error_log_rt_report.rb:102
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `eval'
from /home/www/maldive/admin/releases/20120914030956/vendor/rails/railties/lib/commands/runner.rb:46
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from script/runner:3