Updating existing post gives Regenerating: 1 file(s) changed at 2017-11-06 16:38:19 2017-11-06 16:38:19 - NoMethodError - undefined method `to_api' for nil:NilClass: in collection.rb line 32
See original GitHub issueDescription:
When an existing post is modified and then saved, it gives the following error:
Regenerating: 1 file(s) changed at 2017-11-06 16:38:19 2017-11-06 16:38:19 - NoMethodError - undefined method `to_api' for nil:NilClass:
/home/pi/.rvm/gems/ruby-2.4.1/gems/jekyll-admin-0.7.0/lib/jekyll-admin/server/collection.rb:32:in `block (2 levels) in <class:Server>'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `block in compile!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (3 levels) in route!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:994:in `route_eval'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (2 levels) in route!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1015:in `block in process_route'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `catch'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `process_route'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:973:in `block in route!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `each'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `route!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1085:in `block in dispatch!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block in invoke'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1082:in `dispatch!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `block in call!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block in invoke'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `call!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/bisase.rb:895:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protectioRegRegenerating: 1 file(s) changed at 2017-11-06 16:38:19 2017-11-06 16:38:19 - NoMethodError - undefined method `to_api' for nil:NilClass:
/home/pi/.rvm/gems/ruby-2.4.1/gems/jekyll-admin-0.7.0/lib/jekyll-admin/server/collection.rb:32:in `block (2 levels) in <class:Server>'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `block in compile!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (3 levels) in route!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:994:in `route_eval'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (2 levels) in route!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1015:in `block in process_route'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `catch'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `process_route'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:973:in `block in route!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `each'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `route!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1085:in `block in dispatch!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block in invoke'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1082:in `dispatch!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `block in call!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block in invoke'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `call!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/bisase.rb:895:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/nulllogger.rb:9:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/head.rb:13:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:182:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:2013:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `block in call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/bisase.rb:1787:in `synchronize'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/handler/webrick.rb:88:in `service'
/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/httpserver.rb:140:in `service'
/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/httpserver.rb:96:in `run'
/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/server.rb:290:in `block in start_thread'enerating: 1 file(s) changed at 2017-11-06 16:38:19 2017-11-06 16:38:19 - NoMethodError - undefined method `to_api' for nil:NilClass:
/home/pi/.rvm/gems/ruby-2.4.1/gems/jekyll-admin-0.7.0/lib/jekyll-admin/server/collection.rb:32:in `block (2 levels) in <class:Server>'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `block in compile!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (3 levels) in route!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:994:in `route_eval'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (2 levels) in route!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1015:in `block in process_route'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `catch'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `process_route'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:973:in `block in route!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `each'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `route!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1085:in `block in dispatch!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block in invoke'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1082:in `dispatch!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `block in call!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block in invoke'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `call!'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/bisase.rb:895:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/nulllogger.rb:9:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/head.rb:13:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:182:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:2013:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `block in call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/bisase.rb:1787:in `synchronize'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/handler/webrick.rb:88:in `service'
/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/httpserver.rb:140:in `service'
/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/httpserver.rb:96:in `run'
/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/server.rb:290:in `block in start_thread'n-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/nulllogger.rb:9:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/head.rb:13:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:182:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:2013:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `block in call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/bisase.rb:1787:in `synchronize'
/home/pi/.rvm/gems/ruby-2.4.1/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `call'
/home/pi/.rvm/gems/ruby-2.4.1/gems/rack-1.6.8/lib/rack/handler/webrick.rb:88:in `service'
/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/httpserver.rb:140:in `service'
/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/httpserver.rb:96:in `run'
/home/pi/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/webrick/server.rb:290:in `block in start_thread'
Tell us a bit about yourself:
- Version of JekyllAdmin I’m using <HINT: use
bundle show
to check>: 0.7.0 - Version of Jekyll I’m using <HINT: use
bundle show
to check>: 3.6.2 - Version of NodeJS I’m using <HINT: use
node -v
to check>: 6.11.5 - Operating System <e.g. OS X, Windows>: Raspbian
- Browser <e.g, Safari, Chrome>: Chrome
Steps to reproduce:
- Open /admin/
- click on Posts
- click on any post to edit.
- click on save
I expected the following:
save without any error
But got the following, instead:
On terminal running jekyll, I get the above mentioned error everytime, even though the post appears to be saved. Additionally the UI informs me, ‘Could not update the doc’.
Other details:
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
undefined method `update' for nil:NilClass post scaffold
The above message happens if the record is not found. You should set a condition in your before_action filter to redirect to another...
Read more >Undefined method for nil:NILClass - Workato Docs
This solution prevents the Undefined method for nil:NILClass error from stopping your recipes. Learn more about the safe navigation operator.
Read more >Undefined method pulp3_skip_publication error after upgrade
Problem: After upgrading Foreman from 2.5.3 → 3.0.0 and Katello from 4.1.4 → 4.2.0.1.rc3, syncing an repo gives me error: undefined method ......
Read more >NoMethodError: undefined method `unpack' for nil:NilClass
Solved! u/TunaFishManwich was on the right lines - there was an reference in a file to a location which doesn't exist in this...
Read more >undefined method 'dispose' for nil:NilClass | RPG Maker Forums
I'm trying to make Yami's Order Gauge Script work (in a new project to isolate the script) and keep getting this error when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looks like bringing watch back is causing trouble again. Going to investigate this 👍
This issue has been automatically marked as stale because it has not been commented on for at least two months.
The resources of the Jekyll team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the
master
branch, please reply with all of the information you have about it in order to keep the issue open.If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.
This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.