5

Running:

bundle exec rake assets:precompile RAILS_ENV=production

Takes about 6 minutes for 15 .js files of about 250kb total. It should not take this long surely? I see the 'Microsoft Console Based Script Host' working flat out for most of this time.

What would people recommend / know is possible? Is there a way to replace this with Ruby-Racer or another javascript V8 engine implementation? OR to find out the problem in my code that's causing the long time? Or something else?

AJP
  • 26,547
  • 23
  • 88
  • 127

1 Answers1

1

Which server are you running? Is it Ubuntu, Debian, Mac? Make sure you have this in your Gemfile:

group :production do
  gem "libv8"
  gem "therubyracer", :require => 'v8'
end

See this page for more info: https://github.com/rails/rails/issues/2537

You can also try to remove unused files in your app/assets/* folders. Time is most spent on JS compilation.

Dave
  • 4,356
  • 4
  • 37
  • 40
Fred
  • 356
  • 1
  • 4
  • 4
  • How do I find the unused files in my app/assets folders? For example, how do I know which are unused jquery components, or ckeditor components? – Anand Apr 04 '16 at 02:37
  • You have to analyze the application and identify the assets which are no longer relevant. And if possible, remove them so that they no longer contribute to the assets compilation. – codeonion Apr 01 '22 at 22:58