codegram/spinach — Issue #65: rake aborted! Must be writeable
Author: rupurt
Created: 2011-11-01 03:05:29+00:00
State: open

I've just tried to get up and running with spinach for the first time and got the following error message

rake aborted!
Must be writeable

Doing a trace gives me the following

**/[path-to-gem]/gems/gherkin-2.6.2/lib/gherkin/formatter/json_formatter.rb:16:in `initialize'**
**/[path-to-gem]/gems/spinach-0.1.5.3/lib/spinach/parser.rb:14:in `new'**

The culprit looks like the initialize method of parser.rb where it passes in **nil** to the json formatter. The JSONFormatter class expects that the object can respond_to?(:write) which obviously nil can't

```def initialize(content)
@content = content
@formatter = Gherkin::Formatter::JSONFormatter.new(nil)
@parser = Gherkin::Parser::Parser.new(@formatter)
end```