playgroundbook icon indicating copy to clipboard operation
playgroundbook copied to clipboard

Failed to open and parse playground chapter.

Open ag opened this issue 7 years ago • 5 comments

For some reason I am not able to render the book.yaml file

Output

Rendering book.yaml...
Failed to open and parse playground chapter.
/Library/Ruby/Gems/2.0.0/gems/playgroundbook-1.1.0/lib/renderer/playgroundbook_renderer.rb:68:in `block in render': Missing valid playground for Chapter 1. (RuntimeError)
	from /Library/Ruby/Gems/2.0.0/gems/playgroundbook-1.1.0/lib/renderer/playgroundbook_renderer.rb:46:in `map'
	from /Library/Ruby/Gems/2.0.0/gems/playgroundbook-1.1.0/lib/renderer/playgroundbook_renderer.rb:46:in `render'
	from /Library/Ruby/Gems/2.0.0/gems/playgroundbook-1.1.0/bin/playgroundbook:17:in `<top (required)>'
	from /usr/local/bin/playgroundbook:22:in `load'
	from /usr/local/bin/playgroundbook:22:in `<main>'

Note: I wasn't able to install playgroundbook as described in the readme. When I tried to run

sudo gem install playgroundbook

I got this error

ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/playgroundbook

So I had to install it like this

sudo gem install -n /usr/local/bin playgroundbook

Output

Successfully installed playgroundbook-1.1.0
Parsing documentation for playgroundbook-1.1.0
1 gem installed

ag avatar Mar 31 '17 13:03 ag

Sorry you're having that issue. It looks like the tool is looking for Chapter 1.xcplayground but can't find it. Would you be able to zip + upload the directory containing your playgrounds and yaml file so we can take a look?

ashfurrow avatar Mar 31 '17 14:03 ashfurrow

Sure! play.zip

ag avatar Mar 31 '17 14:03 ag

Gotcha, yup. The chapter names defined in book.yaml have to match up to playgrounds that are in the same directory. Here's a directory with the modifications:

play 2.zip

I removed "Chapter 2" and renamed the playground to "Chapter 1".

We really need better documentation and examples around this, because you're not the first person to run into this problem. We're tracking that issue here and would appreciate input or help you could offer (but no pressure!). Hope that works, let us know 👍

ashfurrow avatar Mar 31 '17 14:03 ashfurrow

Oh yeah obviously ;)

Sure I would love to contribute to this project!

Thanks for the great & fast help!

ag avatar Mar 31 '17 14:03 ag

No problem! You caught me at just the right time :smile: Ideally, we would have a pull request submitted against this repository that adds an example book.yaml, a few chapter playgrounds, and a readme explaining how to render them into a playground book. But if you could do even some of that, it'd be a big help to us.

ashfurrow avatar Mar 31 '17 14:03 ashfurrow