noteflakes / lydown

A language for music notation
http://ciconia.github.io/lydown
MIT License
24 stars 0 forks source link

Looks like a confusion in getting arguments #58

Closed ales-tsurko closed 8 years ago

ales-tsurko commented 8 years ago

Hi! I'm trying to check out installation and when I evaluate lydown --version, I'm getting this error:

{"format"=>:pdf, "path"=>"--version", "source_filename"=>"--version", "output_filename"=>"--version"}
Processing score...
/Library/Ruby/Gems/2.0.0/gems/lydown-0.10.0/lib/lydown/work.rb:56:in `process_work_files': Could not read --version (LydownError)
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.10.0/lib/lydown/work.rb:20:in `initialize'
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.10.0/lib/lydown/cli/compiler.rb:174:in `new'
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.10.0/lib/lydown/cli/compiler.rb:174:in `create_work_from_opts'
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.10.0/lib/lydown/cli/compiler.rb:24:in `process'
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.10.0/lib/lydown/cli/commands.rb:64:in `compile'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.10.0/bin/lydown:5:in `<top (required)>'
    from /usr/local/bin/lydown:23:in `load'
    from /usr/local/bin/lydown:23:in `<main>'

Something similar I get, when I'm trying to compile a lydown file:

Ales:Desktop alestsurko$ lydown -O --pdf HelloWorld.lydown
{"format"=>:pdf, "open_target"=>true, "path"=>"--pdf", "source_filename"=>"--pdf", "output_filename"=>"--pdf"}
Processing score...
/Library/Ruby/Gems/2.0.0/gems/lydown-0.10.0/lib/lydown/work.rb:56:in `process_work_files': Could not read --pdf (LydownError)
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.10.0/lib/lydown/work.rb:20:in `initialize'
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.10.0/lib/lydown/cli/compiler.rb:174:in `new'
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.10.0/lib/lydown/cli/compiler.rb:174:in `create_work_from_opts'
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.10.0/lib/lydown/cli/compiler.rb:24:in `process'
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.10.0/lib/lydown/cli/commands.rb:64:in `compile'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.10.0/bin/lydown:5:in `<top (required)>'
    from /usr/local/bin/lydown:23:in `load'
    from /usr/local/bin/lydown:23:in `<main>'
noteflakes commented 8 years ago

This problem is solved in later versions (I didn't update the version on rubygems for a while). Please reinstall the lydown gem, and let me know if it works.

ales-tsurko commented 8 years ago

Yes, now lydown is running! I see version number and REPL version also works. But I still can't compile...

For pdf target I'm getting this:

Ales:Desktop alestsurko$ lydown -O --pdf helloworld.lydown
Processing score...
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/lib/lydown/work.rb:56:in `process_work_files': Could not read --pdf (LydownError)
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/lib/lydown/work.rb:20:in `initialize'
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/lib/lydown/cli/compiler.rb:176:in `new'
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/lib/lydown/cli/compiler.rb:176:in `create_work_from_opts'
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/lib/lydown/cli/compiler.rb:24:in `process'
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/lib/lydown/cli/commands.rb:74:in `compile'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/bin/lydown:8:in `<top (required)>'
    from /usr/local/bin/lydown:23:in `load'
    from /usr/local/bin/lydown:23:in `<main>'

For png this:

Ales:Desktop alestsurko$ lydown -O --png helloworld.lydown
Processing score...
helloworld.lydown
Parse:========================================================================================================================================:100%
NoMethodError: undefined method `local_variable_set' for #<Binding:0x007f833c48a898>
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/lib/lydown/templates.rb:33:in `block in template_binding'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/lib/lydown/templates.rb:33:in `each'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/lib/lydown/templates.rb:33:in `template_binding'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/lib/lydown/templates.rb:10:in `render'
(erb):29:in `block in template_binding'
(erb):28:in `each'
(erb):28:in `template_binding'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/erb.rb:846:in `eval'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/erb.rb:846:in `block in result'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/erb.rb:847:in `call'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/erb.rb:847:in `result'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/lib/lydown/templates.rb:13:in `render'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/lib/lydown/work.rb:43:in `to_lilypond'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/lib/lydown/cli/compiler.rb:125:in `run_compile_job'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/lib/lydown/cli/compiler.rb:92:in `process_jobs'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/lib/lydown/cli/compiler.rb:27:in `process'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/lib/lydown/cli/commands.rb:74:in `compile'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.1/bin/lydown:8:in `<top (required)>'
/usr/local/bin/lydown:23:in `load'
/usr/local/bin/lydown:23:in `<main>'

For midi and lilypond something similar to what I get for png.

noteflakes commented 8 years ago

I just pushed version 0.12.2 which should fix at least some of these problems. Can you include here the content of your helloworld.lydown file? That way I can try and run it on my machine. Sorry for the difficulties you're having, I haven't touched lydown in a while...

ales-tsurko commented 8 years ago

Still unsuccessful... I get this for pdf and png targets:

Ales:Desktop alestsurko$ lydown -O --pdf helloworld.lydown
Processing score...
Parse:===================================================================================================================================:100%
NoMethodError: undefined method `local_variable_set' for #<Binding:0x007fe95bfdc450>
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/templates.rb:33:in `block in template_binding'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/templates.rb:33:in `each'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/templates.rb:33:in `template_binding'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/templates.rb:10:in `render'
(erb):29:in `block in template_binding'
(erb):28:in `each'
(erb):28:in `template_binding'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/erb.rb:846:in `eval'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/erb.rb:846:in `block in result'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/erb.rb:847:in `call'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/erb.rb:847:in `result'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/templates.rb:13:in `render'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/work.rb:43:in `to_lilypond'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/cli/compiler.rb:133:in `run_compile_job'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/cli/compiler.rb:100:in `process_jobs'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/cli/compiler.rb:35:in `process'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/cli/commands.rb:75:in `compile'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/bin/lydown:8:in `<top (required)>'
/usr/local/bin/lydown:23:in `load'
/usr/local/bin/lydown:23:in `<main>'
Ales:Desktop alestsurko$ lydown -O --png helloworld.lydown
Processing score...
Parse:===================================================================================================================================:100%
NoMethodError: undefined method `local_variable_set' for #<Binding:0x007fca437543c8>
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/templates.rb:33:in `block in template_binding'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/templates.rb:33:in `each'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/templates.rb:33:in `template_binding'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/templates.rb:10:in `render'
(erb):29:in `block in template_binding'
(erb):28:in `each'
(erb):28:in `template_binding'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/erb.rb:846:in `eval'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/erb.rb:846:in `block in result'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/erb.rb:847:in `call'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/erb.rb:847:in `result'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/templates.rb:13:in `render'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/work.rb:43:in `to_lilypond'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/cli/compiler.rb:133:in `run_compile_job'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/cli/compiler.rb:100:in `process_jobs'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/cli/compiler.rb:35:in `process'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/lib/lydown/cli/commands.rb:75:in `compile'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
/Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
/Library/Ruby/Gems/2.0.0/gems/lydown-0.12.2/bin/lydown:8:in `<top (required)>'
/usr/local/bin/lydown:23:in `load'
/usr/local/bin/lydown:23:in `<main>'

Here is the file: helloworld.txt (I've changed extension, because GitHub don't allows me upload .lydown) The content is copypasta from the README.md

noteflakes commented 8 years ago

What version of Ruby do you have? (ruby -v)

noteflakes commented 8 years ago

I figured out what the problem is. You have a version of Ruby prior to 2.1.0. I pushed version 0.12.3 which I tested on Ruby 2.0.0, so you should be good. I wouldn't recommend running lydown with an older version of Ruby.

So you should be good to go now, but please be aware that you should update your helloworld file. The example in the README was outdated (the lydown syntax has since changed slightly with regard to relative octaves and accidentals). Here's the updated example:

\key:D \time:2/4
4d''\"Hello world!" 6cbag 3fgag6fd 4e

Let me know if this solves the problem for you.

ales-tsurko commented 8 years ago

Hurray! It works! Thanks!

noteflakes commented 8 years ago

Great! Let me know if there are anymore issues, or even just suggestions for improvements.