Trying to deploy rails + angular project.
Resolved: turned out (from browser logs) that:
1) There was small error in one of js files.
2) Main module wasn’t loaded because of mess in dependencies, but error message was pinting to one of bootstrap files (?!). Reinstalled twitter-bootstrap gem.
However I still don’t understand why project worked in development and didn’t worh in production.
rails s -e production, rails answers normally, renders layout,
Same issue on local on heroku. Assets are compiled to tmp/… folder. Deploy ends successfully, but angular part doesn’t work (no errors in logs), as well as jquery and all plug-ins.
config.serve_static_files = true config.less.paths << Rails.root.join('app', 'assets', 'bower_components') config.assets.paths << Rails.root.join('app', 'assets', 'bower_components') config.assets.initialize_on_precompile = true config.assets.precompile = ['*.js', '*.css', '*.css.erb', '*.eot', '*.svg', '*.ttf', '*.woff', '*.woff2']
config.assets.js_compressor = :uglifier config.assets.js_compressor = Uglifier.new(:mangle => false) config.assets.digest = true config.assets.compile = true
bundle exec rake:assets:precompile RAILS_ENV=production : does not help.
I think that there is something wrong with loading plug-ins (bower folder, bootstrap, jquery etc.) as main file application.js queried and rendered successfully (logs), but doesn’t work as plug-ins seem not found.
//= require jquery //= require jquery_ujs //= require twitter/bootstrap //= require angular //= require angular-rails-templates //= require angular-devise //= require angular-ui-router //= require angular-route //= require angular-bootstrap //= require angular-touch //= require ng-tags-input //= require angular-loading-bar //= require angular-xeditable //= require ng-file-upload-shim //= require ng-file-upload //= require Buttons //= require x-editable //= require angular-ui-notification //= require_tree ../templates //= require_tree . angular.module('boo', ['boo-factories', 'boo-controllers', 'ui-notification', 'ngTagsInput', 'angular-loading-bar', 'ui.router', 'ui.bootstrap', 'templates', 'Devise', 'ngFileUpload', 'xeditable', 'bootstrapLightbox']);
and so on…