How to enable rdiscount extra markdown 'generate_toc' on Octopress - octopress

I tried to make Octopress generate TOC with default markdown parser Rdiscount (2.1.7) by configuring _config.yml, but it didn't work and rake generate failed.
I tried answers in RDiscount :generate_toc with Sinatra, but it didn't work for me neither.
So I wonder if there's way to configure Octopress Rdiscount extra markdown syntax like this:
markdown: rdiscount
rdiscount:
extensions:
- autolink
- footnotes
- smart
- generate_toc
After set rdiscount in _config.yml and rake generate, I got an build error as follow:
sunnogo#a3e420:~/github/octopress$ rake generate
## Generating Site with Jekyll
identical source/stylesheets/screen.css
Configuration from /home/sunnogo/github/octopress/_config.yml
Building site: source -> public
Liquid Exception: can't convert nil into String in atom.xml
/var/lib/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/converters/markdown.rb:139:in `include?'
/var/lib/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/converters/markdown.rb:139:in `convert'
/var/lib/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/filters.rb:25:in `markdownify'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/context.rb:58:in `invoke'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/variable.rb:43:in `block in render'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/variable.rb:38:in `each'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/variable.rb:38:in `inject'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/variable.rb:38:in `render'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:94:in `block in render_all'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `collect'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `render_all'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/tags/for.rb:116:in `block (2 levels) in render'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/tags/for.rb:104:in `each'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/tags/for.rb:104:in `each_with_index'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/tags/for.rb:104:in `block in render'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/context.rb:91:in `stack'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/tags/for.rb:103:in `render'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:94:in `block in render_all'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `collect'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `render_all'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:82:in `render'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/template.rb:124:in `render'
/var/lib/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/template.rb:132:in `render!'
/var/lib/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/convertible.rb:79:in `do_layout'
/home/sunnogo/github/octopress/plugins/post_filters.rb:167:in `do_layout'
/var/lib/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/page.rb:100:in `render'
/home/sunnogo/github/octopress/plugins/category_generator.rb:100:in `write_category_index'
/home/sunnogo/github/octopress/plugins/category_generator.rb:111:in `block in write_category_indexes'
/home/sunnogo/github/octopress/plugins/category_generator.rb:110:in `each'
/home/sunnogo/github/octopress/plugins/category_generator.rb:110:in `write_category_indexes'
/home/sunnogo/github/octopress/plugins/category_generator.rb:139:in `generate'
/var/lib/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/site.rb:190:in `block in generate'
/var/lib/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/site.rb:189:in `each'
/var/lib/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/site.rb:189:in `generate'
/var/lib/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/site.rb:40:in `process'
/var/lib/gems/1.9.1/gems/jekyll-0.12.0/bin/jekyll:264:in `<top (required)>'
/usr/local/bin/jekyll:23:in `load'
/usr/local/bin/jekyll:23:in `<main>'
Build Failed

The problem you're seeing is due to a bug in Jekyll that has since been fixed. Specifically, Jekyll assumes that if you specify generate_toc then you also specify toc_token, which is the string you can write in your document to cause Jekyll to insert the table of contents.
An updated _config.yml would look like this:
markdown: rdiscount
rdiscount:
extensions:
- autolink
- footnotes
- smart
- generate_toc
toc_token: "!TOC"
And then you would insert !TOC in your markdown document at the point where you want the table of contents to appear.

Related

'Jekyll Serve' Error

I'm trying to run my jekyll site locally but when executing the command:
jekyll serve
I receive the following error message:
bhavik-imac:dhokes.github.io bhavikdhokia$ jekyll serve
Configuration file: /Users/bhavikdhokia/Development/git/dhokes.github.io/_config.yml
/Users/bhavikdhokia/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- jekyll-sitemap (LoadError)
from /Users/bhavikdhokia/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:29:in `block in require_gems'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:26:in `each'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:26:in `require_gems'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:19:in `conscientious_require'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1/gems/jekyll-2.5.3/lib/jekyll/site.rb:79:in `setup'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1/gems/jekyll-2.5.3/lib/jekyll/site.rb:41:in `initialize'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:29:in `new'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:29:in `process'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1/gems/jekyll-2.5.3/lib/jekyll/commands/serve.rb:26:in `block (2 levels) in init_with_program'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1#global/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1#global/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1#global/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1#global/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1#global/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1#global/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1/gems/jekyll-2.5.3/bin/jekyll:20:in `<top (required)>'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1/bin/jekyll:23:in `load'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1/bin/jekyll:23:in `<main>'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
from /Users/bhavikdhokia/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'
Any suggestions as to why this is and how to resolve this?
Seems like you have to install jekyll-sitemap Try to install it by gem install jekyll-sitemap.
For people Googling this problem, also try bundle update if you're using bundle.

Error when running jekyll in Linux Mint 17.1

I just set up Jekyll on my Linux machine and installed (I think) all the necessary dependencies. When I try to run jekyll serve or jekyll build, I get the error displayed below. However, if I run jekyll new "test" to create a new site, it works just fine.
Here is the error message I am receiving (it's the exact same for serve and build):
Configuration file: /home/michael/Dev/github-site/_config.yml
/home/michael/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- jekyll-sitemap (LoadError)
from /home/michael/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/michael/.rvm/gems/ruby-2.2.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:29:in `block in require_gems'
from /home/michael/.rvm/gems/ruby-2.2.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:26:in `each'
from /home/michael/.rvm/gems/ruby-2.2.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:26:in `require_gems'
from /home/michael/.rvm/gems/ruby-2.2.0/gems/jekyll-2.5.3/lib/jekyll/plugin_manager.rb:19:in `conscientious_require'
from /home/michael/.rvm/gems/ruby-2.2.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:79:in `setup'
from /home/michael/.rvm/gems/ruby-2.2.0/gems/jekyll-2.5.3/lib/jekyll/site.rb:41:in `initialize'
from /home/michael/.rvm/gems/ruby-2.2.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:29:in `new'
from /home/michael/.rvm/gems/ruby-2.2.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:29:in `process'
from /home/michael/.rvm/gems/ruby-2.2.0/gems/jekyll-2.5.3/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
from /home/michael/.rvm/gems/ruby-2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call'
from /home/michael/.rvm/gems/ruby-2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute'
from /home/michael/.rvm/gems/ruby-2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each'
from /home/michael/.rvm/gems/ruby-2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute'
from /home/michael/.rvm/gems/ruby-2.2.0/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go'
from /home/michael/.rvm/gems/ruby-2.2.0/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program'
from /home/michael/.rvm/gems/ruby-2.2.0/gems/jekyll-2.5.3/bin/jekyll:20:in `<top (required)>'
from /home/michael/.rvm/gems/ruby-2.2.0/bin/jekyll:23:in `load'
from /home/michael/.rvm/gems/ruby-2.2.0/bin/jekyll:23:in `<main>'
from /home/michael/.rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:in `eval'
from /home/michael/.rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:in `<main>'
Any help would be greatly appreciated, I'm new to using Jekyll and Ruby.
Try to do a :
gem install jekyll-sitemap

ruby - Error with installing bluecloth-2.2.0 gem in Win 7 , ruby 1.9.3

Was following steps described in https://stackoverflow.com/a/13544086/3206440 for resolving error with bluecloth-2.2.0 gem installation in windows 7. Encountered an error in step 4 given in the above link - any ideas?
Console output below.
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0>rake gem
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bluecloth-2.2.0/Rakefile:24
: Use RbConfig instead of obsolete and deprecated Config.
Defaulting gemspec to MIT license.
Call license in hoe spec to change.
rake aborted!
Don't know how to build task '.gemtest'
Tasks: TOP => gem => pkg/bluecloth-2.2.0.gem
(See full trace by running task with --trace)
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0>rake gem --
trace
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bluecloth-2.2.0/Rakefile:24
: Use RbConfig instead of obsolete and deprecated Config.
Defaulting gemspec to MIT license.
Call license in hoe spec to change.
** Invoke gem (first_time)
** Invoke pkg/bluecloth-2.2.0.gem (first_time)
rake aborted!
Don't know how to build task '.gemtest'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task_m
anager.rb:62:in `[]'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:57:in `lookup_prerequisite'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:53:in `block in prerequisite_tasks'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:53:in `map'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:53:in `prerequisite_tasks'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:199:in `invoke_prerequisites'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:178:in `block in invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:172:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:201:in `block in invoke_prerequisites'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:199:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:199:in `invoke_prerequisites'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:178:in `block in invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:172:in `invoke_with_call_chain'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/task.r
b:165:in `invoke'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:150:in `invoke_task'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:106:in `block (2 levels) in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:106:in `each'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:106:in `block in top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:115:in `run_with_threads'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:100:in `top_level'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:78:in `block in run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:176:in `standard_exception_handling'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/lib/rake/applic
ation.rb:75:in `run'
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.3.2/bin/rake:33:in
`<top (required)>'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `load'
C:/RailsInstaller/Ruby1.9.3/bin/rake:23:in `<main>'
Tasks: TOP => gem => pkg/bluecloth-2.2.0.gem
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0>cd ..
If your using Hoe then be sure to disable some of the plugins. I'm not sure which ones are enabled by default but you could certainly try that first.
Homepage here
I would suggest starting out with the list of them like so:
Hoe.plugins.delete :newb
and then just comment them out as needed.
Please create .gemtest folder in root of project

Rake "already initialized constant WFKV_" warning

Trying to run rake cucumber:ok and am getting this error:
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
Then:
Command failed with status (1): [/Users/dev/.rbenv/versions/1.9.2-p290/bin...]
I am pretty new to Rails and Google didn't turn anything up for this error.
EDIT: I've tried adding bundle exec and that makes no difference.
Here's what I got with --trace:
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:45:in `call'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:45:in `sh'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/file_utils_ext.rb:36:in `sh'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/cucumber-1.1.0/lib/cucumber/rake/task.rb:104:in `run'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/cucumber-1.1.0/lib/cucumber/rake/task.rb:193:in `block in define_task'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/dev/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/dev/.rbenv/versions/1.9.2-p290/bin/rake:19:in `load'
/Users/dev/.rbenv/versions/1.9.2-p290/bin/rake:19:in `<main>'
Tasks: TOP => cucumber:ok
I started having the same problem this evening. It seems to be related to Rack 1.3.4. I fixed it by adding this to my Gemfile:
gem 'rack', '1.3.3'
Then running:
bundle update rack
Incidentally, I tried Bozhidar's suggestion before this, but to no avail.
Rack 1.3.5 is out now, which has fixed this warning.
you should uninstall rake-0.9.2
and install rack 1.6.13
gem uninstall rake
gem install rack 1.6.13
So, I included:
require 'uri/common'; ::URI.send :remove_const, :WFKV_
however the comment which says "it will work in the Gemfile" in fact should read "Must be in the Gemfile."

How do I suppress the huge stack trace after a rake TestTask failure?

I'm setting up a rakefile for a project, and I've defined some rake TestTasks. I ran a simple sanity test that does an assert_equal(1, 2) just to check the output, and, in addition to the usual failure output, I get this mess:
rake aborted!
Command failed with status (1): [/usr/bin/ruby -w -I"lib:." "/usr/lib/ruby/...]
/usr/lib/ruby/1.9.1/rake.rb:993:in `block in sh'
/usr/lib/ruby/1.9.1/rake.rb:1008:in `call'
/usr/lib/ruby/1.9.1/rake.rb:1008:in `sh'
/usr/lib/ruby/1.9.1/rake.rb:1092:in `sh'
/usr/lib/ruby/1.9.1/rake.rb:1027:in `ruby'
/usr/lib/ruby/1.9.1/rake.rb:1092:in `ruby'
/usr/lib/ruby/1.9.1/rake/testtask.rb:115:in `block (2 levels) in define'
/usr/lib/ruby/1.9.1/rake.rb:1110:in `verbose'
/usr/lib/ruby/1.9.1/rake/testtask.rb:100:in `block in define'
/usr/lib/ruby/1.9.1/rake.rb:634:in `call'
/usr/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
/usr/lib/ruby/1.9.1/rake.rb:629:in `each'
/usr/lib/ruby/1.9.1/rake.rb:629:in `execute'
/usr/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
/usr/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/usr/lib/ruby/1.9.1/rake.rb:605:in `block in invoke_prerequisites'
/usr/lib/ruby/1.9.1/rake.rb:602:in `each'
/usr/lib/ruby/1.9.1/rake.rb:602:in `invoke_prerequisites'
/usr/lib/ruby/1.9.1/rake.rb:594:in `block in invoke_with_call_chain'
/usr/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
/usr/lib/ruby/1.9.1/rake.rb:581:in `invoke'
/usr/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task'
/usr/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level'
/usr/lib/ruby/1.9.1/rake.rb:2019:in `each'
/usr/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level'
/usr/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
/usr/lib/ruby/1.9.1/rake.rb:1992:in `run'
/usr/bin/rake:31:in `<main>'
How do I get rid of it? I don't want to have to scroll up past 20 lines of junk to see my test failures.
I had the same problem as you and solved it by updating rake: gem install rake
This updated from whatever I had to 0.8.7.
I'm running 1.9.2-p180 (OS X, installed with Homebrew) and was running tests on a newly created project (made with Hoe).
Rake shouldn't be returning a backtrace in this situation -- the error is with the external command, not rake's internals. I've sent a email to Jim Weirich regarding the following patch: https://gist.github.com/1003628
Rake normally does not show a backtrace unless you specify --trace. Perhaps you have configured Rake to always run in --trace mode?
By default, rake does not print out the stack trace if you get an error in the code that rake calls. You can get the stack trace by running with the --trace flag, but usually I'd just rather see it anyway. You can do that by putting Rake.application.options.trace = true into the rakefile.
If not, you might try setting Rake.application.options.trace = false in your Rakefile.
I still had unwanted stack traces in rake 0.8.7, updating to 0.9.2 finally helped for me (ruby 1.9.2p180 [i386-mingw32] on Win7 32bit).
Look in config/initializers/backtrace_silencers.rb
You should be able to add something like
Rails.backtrace_cleaner.add_silencer { |line| line =~ %r{/usr/lib/ruby/1.9.1/rake.rb} }

Resources