jquery - Rails and Javascript in production environment -
hello stack overflow community! new ruby on rails, , nearing end of first project, having little bit of trouble getting app production ready.
my first problem needed refresh page personal jquery work. fixed problem adding jquery-turbolinks gem project , adding jquery.turbolinks manifest file.
however, quick solution did not work production environment, reason. changed ordering of stuff in manifest file, changed config.serve_static_files false , config.assets.compile true (in production.rb). none of js works in production.
then, info gathered web, ran bundle exec rake assets:precompile. none of js or css effects evident in production!
so finally, undo blunder, ran bundle exec rake assets:clean. terminal complaining have "untracked files" when committing changes git.
clearly, i'm in absolutely messy situation. other blunder, project running smoothly, greatly, appreciated.
ps: works in development environment...
welcome stackoverflow!
from you've explained, seems running precompile locally didn't quite work, , attempt run rake assets:clean
has left git saying there changes need committed.
in sprockets, running rake assets:clean
removes old assets (keeps recent 3 copies) public/assets - [source]. running command altered public/assets directory, , these changes have not been committed, hence terminal complaining.
if wish wipe public/assets
, generate assets scratch, can following:
rake assets:clobber rails_env=production bundle exec rake assets:precompile
using clobber
destroy assets directory, while precompile
command following rebuild assets in way should reflect production environment. once commit these changes , deploy, new assets should display in production.
hope helps!
Comments
Post a Comment