我正在运行Rails 5和Ember& ember-cli-rails
宝石。我在Rails资源文件夹中没有太多,因为我有一个单独的前端文件夹,ember-cli-rails
帮助我将我的Ember应用程序挂载到Rails路由。
我部署到AWS实例,每当我运行rake assets:precompile
时,它就会挂起:
$ 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
我需要更新Ruby吗?可能不对?
无论如何,我读过this post等等,我已经确定这个问题更多是个案问题,并没有一个适合所有解决方案。所以我在这里提供有关我的项目的信息,希望能够诊断出问题。
我的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'
我有大量的Ember代码,这是我在运行rails s
后加载Ember应用程序时的输出:
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)
所以它已经需要一些时间,但它似乎在我的EC2实例上,这次以指数方式膨胀。有什么想法吗?我应该增加内存吗?我觉得这不是理想的解决方案。
TL; DR:
ember-cli-rails
宝石出了什么问题?assets:precompile
?答案 0 :(得分:2)
--verbose
不是一个选项,但rake some_command --trace
是一个选项!!它帮助我识别了我的ember版本的一些依赖性问题。