1

After dealing with a problem where heroku rejected to push because of assets rejection (When deploying heroku app I get push rejected error (Precompiling assets failed)), solution was this command: RAILS_ENV=production bundle exec rake assets:precompile.

Now my app is finally pushed to heroku and there is no longer default message on the app URL, however page is now blank.

This is my Gemfile:

source 'https://rubygems.org'

gem 'rails', '4.2.2'

gem 'sass-rails', '~> 5.0'

gem 'uglifier', '>= 1.3.0'

gem 'jquery-rails'

gem 'turbolinks'

gem 'jbuilder', '~> 2.0'

gem 'sdoc', '~> 0.4.0', group: :doc
# rake
gem 'rake', '11.1.2'
# csv reader
gem 'smarter_csv'
# bower rails
gem 'bower-rails'
# angular templates
gem 'angular-rails-templates'
# angular material
gem 'rails-angular-material'
# jquery ui
gem 'jquery-ui-rails'
# ionicons
gem 'ionicons-rails'
# Get user location info
gem 'geocoder'

group :development, :test do
  gem 'byebug'
  gem 'sqlite3'
end

  gem 'spring'

group :development do
  gem 'web-console', '~> 2.0'
end

group :test do
  gem 'minitest-reporters', '1.0.5'
  gem 'mini_backtrace',     '0.1.3'
  gem 'guard-minitest',     '2.3.1'
end

group :production do
  gem 'pg'
  gem 'rails_12factor'
end

ruby "2.2.1"

And this is my Bowerfile:

asset 'angular'
asset 'angular-route'
asset 'angular-material'

On the screenshot there are 3 windows, source code from heroku app, heroku app (blank page) and same app on localhost. Whole file structure can be seen here: https://github.com/kunokdev/flightmap because I really don't know which part could cause this problem. How do I fix this to properly show my web page?

enter image description here

There were no errors in console when I was pushing it, however this line caught my eye:

 remote:        Detected manifest file, assuming assets were compiled locally

The whole console log can be found here: https://jpst.it/GTtq

Community
  • 1
  • 1
Kunok
  • 8,089
  • 8
  • 48
  • 89
  • What the heroku logs tell you? Did you get any error? – Pavan Apr 09 '16 at 09:50
  • @Pavan No errors. I just edited question, there was one line that could have effect on this. (look at the bottom of the question). The whole console log can be found here: https://jpst.it/GTtq – Kunok Apr 09 '16 at 09:50
  • 1
    Javascript console displaying errors? – Ruby Racer Apr 09 '16 at 10:38
  • Ohh, Now I feel embarrassed for not checking that, yes there is an error: `"Error: [$injector:unpr] Unknown provider: eProvider <- e <- DialogCtrl.` Ok now I see where is the problem, Rails minifies file and my Angular syntax is not working when minified. Is there a way to tell Rails that I do not want to minify specific file? – Kunok Apr 09 '16 at 11:07

1 Answers1

1

The problem was actually in Angular code. Ruby on Rails minifies files on production which led to broken code in one of Angular controllers which is answered here: Angular code gets broken after minified and concated by Ruby on Rails

Community
  • 1
  • 1
Kunok
  • 8,089
  • 8
  • 48
  • 89
  • Yes, I strongly advise reading through an Angular tutorial. This problem has not to do with rails but with minification. Every tutorial points out the fact that dependency injection should be done that way to avoid broken code during minification. – Ruby Racer Apr 09 '16 at 13:30