GoBoundless / spar

Single Page Application Rocketship
http://goboundless.github.com/spar/
MIT License
164 stars 14 forks source link

Exception running local deploy script #17

Open gerfarfel opened 11 years ago

gerfarfel commented 11 years ago

I wanted to see how local deploys work, so I went into the "my app" sample app and added the following into config.yml:

staging:
 deploy_strategy: local
 deploy_path: compiled/staging

Then I tried running "spar deploy staging" from the myapp directory (after first creating the compiled/staging directory), but got the following. Where did I go wrong?

/Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/sprockets-2.8.1/lib/sprockets/base.rb:153:in 'resolve': couldn't find file 'bootstrap/component.json' (Sprockets::FileNotFound) from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/spar-1.0.9/lib/spar/compiler.rb:48:in 'path_compile_info' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/spar-1.0.9/lib/spar/compiler.rb:10:in 'block in assets' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/sprockets-2.8.1/lib/sprockets/base.rb:341:in 'block in each_logical_path' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/sprockets-2.8.1/lib/sprockets/base.rb:324:in 'block (2 levels) in each_file' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/sprockets-2.8.1/lib/sprockets/base.rb:314:in 'each' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/sprockets-2.8.1/lib/sprockets/base.rb:314:in 'each_entry' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/sprockets-2.8.1/lib/sprockets/base.rb:322:in 'block in each_file' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/sprockets-2.8.1/lib/sprockets/base.rb:321:in 'each' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/sprockets-2.8.1/lib/sprockets/base.rb:321:in 'each_file' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/sprockets-2.8.1/lib/sprockets/base.rb:335:in 'each_logical_path' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/spar-1.0.9/lib/spar/compiler.rb:9:in 'assets' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/spar-1.0.9/lib/spar/cli.rb:37:in 'deploy' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/task.rb:27:in 'run' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:120:in 'invoke_task' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor.rb:275:in 'dispatch' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/base.rb:425:in 'start' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/gems/spar-1.0.9/bin/spar:26:in '<top (required)>' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/bin/spar:19:in 'load' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/bin/spar:19:in '

' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/bin/ruby_noexec_wrapper:14:in 'eval' from /Users/dickfryling/.rvm/gems/ruby-1.9.3-p286/bin/ruby_noexec_wrapper:14:in '
'

mhodgson commented 11 years ago

Hi there, this is a tough one to work out without seeing your code. Any chance you can add me to the repo?

gerfarfel commented 11 years ago

Sorry, I forgot that there was a separate github repo for the spar examples - maybe I should have entered the issue over there. Literally, all I did was to take the "my-app" sample app, modify config.yml as described above, and run "spar deploy staging". There were no other changes to the code. Maybe there's a problem with my installation or configuration, but I haven't had any other problems (like creating new spar apps or running the spar server). So, just to be clear - can you simply replicate what I did (add 3 lines to config.yml in the my-app example and run "spar deploy staging") and let me know if that works for you? If it does, I'll try to do some more debugging on my end. Thanks!

gerfarfel commented 11 years ago

The "my-app" example appears to be configured incorrectly (perhaps for an older version of spar?). Instead of having the external libraries in the "vendor" folder, they're in the "components" folder. I still haven't gotten things working, though (still getting complaints about bootstrap), so it would be helpful to have the example fixed.

gerfarfel commented 11 years ago

Okay, here's where I'm at... I removed the "components" folder from "my-app" - having it in there produces the exception from my original post. I placed all relevant js files (backbone-min.js, bootstrap.min.js, etc.) into "my-app/vendor/javascripts" and css files (bootstrap.css, bootstrap-responsive.css) into "my-app/vendor/stylesheets". Now, when I run "spar deploy staging", I don't see any exceptions or other errors - but the only files that are copied into the compiled/staging folder are: about.html, bootstrap.min.js, favicon.ico, home.html, and index.html. So, from what I can see, application.js.coffee isn't being compiled (or copied to the output folder, at least), and the only external library files that are being copied over are ones that end with "min.js". I would help to have confirmation that local deploys of the example apps work properly for you. Thanks...

gerfarfel commented 11 years ago

Clearly I should have reported this problem over in the spar-examples repo. Both the my-app and todo examples are missing deploy directives at the top of the application.js.coffee and application.css.sass files. You should probably fix that.

As to the problem from my original post (the "couldn't find file 'bootstrap/component.json'" exception) - that goes away when components folder is removed from my-app. It's easy enough to work around the issue, but you should probably look into it to make sure others don't have the same problem.

aaronwhite commented 11 years ago

Running headlong into the same stuff.

We should treat this error (presently) as local file deployment of spay example todo app fails outright