问题
Fresh installation of Jekyll and Octopress. On starting the server, it yields:
Homes-MacBook-Pro:octopress home$ jekyll serve
Configuration file: /Users/home/octopress/_config.yml
Source: source
Destination: public
Generating... error: wrong number of arguments (1 for 2). Use --trace to view backtrace
on performing the trace:
Homes-MacBook-Pro:octopress home$ jekyll serve --trace
Configuration file: /Users/home/octopress/_config.yml
Source: source
Destination: public
Generating... /Users/home/octopress/plugins/pagination.rb:72:in `pagination_enabled?': wrong number of arguments (1 for 2) (ArgumentError)
from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.1/lib/jekyll/generators/pagination.rb:16:in `generate'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.1/lib/jekyll/site.rb:227:in `block in generate'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.1/lib/jekyll/site.rb:226:in `each'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.1/lib/jekyll/site.rb:226:in `generate'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.1/lib/jekyll/site.rb:38:in `process'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.1/lib/jekyll/command.rb:18:in `process_site'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.1/lib/jekyll/commands/build.rb:23:in `build'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.1/lib/jekyll/commands/build.rb:7:in `process'
from /Library/Ruby/Gems/2.0.0/gems/jekyll-1.4.1/bin/jekyll:97:in `block (2 levels) in <top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
from /Library/Ruby/Gems/2.0.0/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
from /Library/Ruby/Gems/2.0.0/gems/commander-4.1.5/lib/commander/command.rb:155:in `run'
from /Library/Ruby/Gems/2.0.0/gems/commander-4.1.5/lib/commander/runner.rb:402:in `run_active_command'
from /Library/Ruby/Gems/2.0.0/gems/commander-4.1.5/lib/commander/runner.rb:78:in `run!'
from /Library/Ruby/Gems/2.0.0/gems/commander-4.1.5/lib/commander/delegates.rb:7:in `run!'
from /Library/Ruby/Gems/2.0.0/gems/commander-4.1.5/lib/commander/import.rb:10:in `block in <top (required)>'
Homes-MacBook-Pro:octopress home$
Any ideas?
回答1:
Jekyll 1.1 introduces a bug fix which breaks the pagination.rb plugin within Octopress. Please see this pull request for a fix: https://github.com/imathis/octopress/pull/1447
In the meantime, you can take the pagination.rb file used in that pull request and overwrite the one in your plugins directory. That should fix the error message you are seeing.
However, I would recommend that instead of calling "jekyll serve", use the rake tasks provided by Octopress. That should fix it as well:
$ rake generate
or
$ rake preview
来源:https://stackoverflow.com/questions/20700208/wrong-number-of-arguments-1-for-2-while-serving-jekyll