jamesrwhite / minicron

🕰️ Monitor your cron jobs
GNU General Public License v3.0
2.34k stars 154 forks source link

Example config file is not compatible #171

Closed maatthc closed 8 years ago

maatthc commented 8 years ago

Guys, the file gems/minicron-0.8.3/lib/minicron/cli/commands.rb:135 is refering to: Minicron.config['client']['server']['scheme'] but the example config file (https://github.com/jamesrwhite/minicron/blob/master/config/nginx.conf) uses: [client] scheme = "http" # [http, https] host = "127.0.0.1" port = 9292 path = "/"

So it causes a error: minicron run --verbose ls --trace undefined method `[]' for nil:NilClass

/opt/minicron/lib/vendor/ruby/2.2.0/gems/minicron-0.8.3/lib/minicron/cli/commands.rb:136:in block (2 levels) in add_run_cli_command': undefined method[]' for nil:NilClass (NoMethodError) from /opt/minicron/lib/vendor/ruby/2.2.0/gems/commander-4.3.5/lib/commander/command.rb:178:in call' from /opt/minicron/lib/vendor/ruby/2.2.0/gems/commander-4.3.5/lib/commander/command.rb:178:incall' from /opt/minicron/lib/vendor/ruby/2.2.0/gems/commander-4.3.5/lib/commander/command.rb:153:in run' from /opt/minicron/lib/vendor/ruby/2.2.0/gems/commander-4.3.5/lib/commander/runner.rb:428:inrun_active_command' from /opt/minicron/lib/vendor/ruby/2.2.0/gems/commander-4.3.5/lib/commander/runner.rb:68:in run!' from /opt/minicron/lib/vendor/ruby/2.2.0/gems/minicron-0.8.3/lib/minicron/cli.rb:82:inrun' from /opt/minicron/lib/vendor/ruby/2.2.0/gems/minicron-0.8.3/bin/minicron:14:in block in <top (required)>' from /opt/minicron/lib/vendor/ruby/2.2.0/gems/minicron-0.8.3/lib/minicron.rb:162:incapture_output' from /opt/minicron/lib/vendor/ruby/2.2.0/gems/minicron-0.8.3/bin/minicron:12:in <top (required)>' from /opt/minicron/lib/vendor/ruby/2.2.0/bin/minicron:23:inload' from /opt/minicron/lib/vendor/ruby/2.2.0/bin/minicron:23:in `

'

jamesrwhite commented 8 years ago

I'm pretty sure this is the same as https://github.com/jamesrwhite/minicron/issues/169, I would look at how it was solved threre. The example config was out of date but I've updated that. I hadn't pushed that changed from develop to master but I have done now. Feel free to re-open if you are still having this issue.