在浏览http://testfirst.org/learn_javascript时,我尝试在 00_hello/ 文件夹中运行 rake jasmine。我收到此错误:
hugos-MacBook-Pro:00_hello hugo$ rake jasmine --trace
(in /Users/hugo/Developer/test_first_javascript/learn_javascript)
** Invoke jasmine (first_time)
** Invoke jasmine:server (first_time)
** Invoke jasmine:require (first_time)
** Execute jasmine:require
** Execute jasmine:server
your tests are here:
http://localhost:8888/
rake aborted!
(<unknown>): did not find expected alphabetic or numeric character while scanning an alias at line 5 column 7
/Users/hugo/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:203:in `parse'
/Users/hugo/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
/Users/hugo/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:151:in `parse'
/Users/hugo/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:127:in `load'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.1/lib/jasmine/config.rb:19:in `simple_config'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.1/lib/jasmine/config.rb:62:in `spec_dir'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.1/lib/jasmine/runner_config.rb:32:in `spec_dir'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.1/lib/jasmine/application.rb:28:in `block (2 levels) in app'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:141:in `new'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:141:in `block in generate_map'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:141:in `each'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:141:in `generate_map'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:128:in `to_app'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:55:in `app'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.1/lib/jasmine/application.rb:14:in `app'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.1/lib/jasmine/server.rb:3:in `initialize'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.1/lib/jasmine/tasks/jasmine.rake:51:in `new'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/jasmine-1.2.1/lib/jasmine/tasks/jasmine.rake:51:in `block (2 levels) in <top (required)>'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/hugo/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/hugo/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/bin/rake:19:in `load'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/bin/rake:19:in `<main>'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
/Users/hugo/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => jasmine => jasmine:server
我做了一些调查,发现了这个:http ://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680227 。可能是我的 ruby 解析器错误/我使用了错误版本的 ruby。
hugos-MacBook-Pro:00_hello hugo$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0]
想法?