html5 - Javascript Error on Sinatra with NGINX with Unicorn -


i have made site runs on nginx unicorn web server, , sinatra. created site locally, , worked great. however, after uploading, countdown on home page not working. when inspect chrome (the web version, located @ http://udidreg.com), following errors:

uncaught typeerror: object [object object] has no method 'placeholder' customtime.js:41

and

uncaught typeerror: object [object object] has no method 'countdown'

however, when inspect locally, there no errors, , counts should.

any appreciated!

twothree things come mind.

  • you've not deployed updated customtime.js file, though think have.
  • the customtime.js has been cached browser , hasn't collected new one.
  • the project's requirements (such gems, scripts etc) aren't described gemfile etc , due way development environment set don't these errors on dev machine.

be careful sandbox environment as possible, , make sure things project requires within project.

a classic example developing on machine account has administrator role, , deploying machine runs app under account limited permissions.

the classic ruby development have installed gems system wide using rubygems, , install gems via bundler project. though few of required gems missed off gemfile, because required gems installed system wide no errors occur. on deployment these gems found missing , app fails.

to stop happening, sandbox project's gems using bundler (if are) command bundle install --binstubs --path vendor, , run via bundle exec… or bin dir e.g. bin/rackup config.ru. project only running gems installed via bundler. if missing fail both on development machine , production machine. better.

to handle out of date assets javascripts , stylesheets, favour the method used in helpful blog post. i've forked sinatra::staticassets gem , rewritten incorporate it, i'm not entirely finished (though still has power destroy planets, i'm worried attacks 1 manned fighters), if you've github account , sounds may of use you can follow it. if want try add development branch gemfile , sure let me know if works or badly you.

edit: i finished fork , made own gem


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -