ruby-on-railsruby-on-rails-5rails-assetsember-cli-rails

Rails 5 assets:precompile hangs


I am running Rails 5 with Ember & ember-cli-rails gem. I don't have much in the Rails assets folder because I have a separate frontend folder and ember-cli-rails helps me mount my Ember app to a Rails route.

I deploy to an AWS instance and whenever I run rake assets:precompile, it just hangs:

$ rake assets:precompile
RubyDep: WARNING: Your Ruby is outdated/buggy.
RubyDep: WARNING: Your Ruby is: 2.3.0 (buggy). Recommendation: upgrade to 2.3.1.
RubyDep: WARNING: (To disable warnings, see:http://github.com/e2/ruby_dep/wiki/Disabling-warnings )
up to date in 1.441s

Could it be that I need to update Ruby? Probably not right?

Anyway, I read this post amongst others and I have decided that this problem is more so a case by case issue and does not have a one size fits all solution. So I am here to present info about my project in hopes of diagnosing the problem.

My Gemfile:

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

gem 'twilio-ruby'
gem 'phony_rails'
gem 'jquery-rails'
gem 'intl-tel-input-rails'
gem 'mysql2'
gem 'sidekiq'
gem 'sidekiq-scheduler'

gem "capistrano", "~> 3.4"
gem 'capistrano-rails'
gem 'capistrano-bundler'
gem 'capistrano-rbenv'
gem 'capistrano3-puma'

gem 'ember-cli-rails'
gem 'active_model_serializers', '~> 0.10.0'

I have a good amount of Ember code and this is the output when I load the Ember app after running rails s:

Build successful (21977ms)


Slowest Nodes (totalTime => 5% )              | Total (avg)         
----------------------------------------------+---------------------
Babel (28)                                    | 15879ms (567 ms)    
EslintValidationFilter (2)                    | 2292ms (1146 ms)    

  Rendering html template
  Rendered html template (0.1ms)
  Rendered /usr/local/lib/ruby/gems/2.4.0/gems/ember-cli-rails-0.9.0/app/views/ember_cli/ember/index.html.erb (32443.1ms)
Completed 200 OK in 32465ms (Views: 32453.4ms | ActiveRecord: 0.0ms)

So it already takes some time but it seems on my EC2 instance, this time inflates exponentially. Any ideas why? Should I just increase the RAM? I feel like that is not the ideal solution.

tl;dr:

  1. Is something wrong with the ember-cli-rails gem?
  2. What can I do to speed up assets:precompile?
  3. Is it good practice to just up the power of my ec2 instance?
  4. What can I do to debug this (logs, more verbose output, etc.)?

Solution

    1. Upgrading to ember-cli 3.0 seems to have fixed the problem
    2. Have less JS, although this shouldn't affect it that much, was unrelated for this problem
    3. Yes, but this was solvable in other ways
    4. Apparently --verbose isn't an option BUT rake some_command --trace IS an option!! It helped me identify some dependency problem with my ember version.