tsechingho / ckeditor-rails

Integrate CKEditor javascript library with Rails asset pipeline
https://github.com/tsechingho/ckeditor-rails
MIT License
213 stars 134 forks source link

assets:precompile takes a long time #45

Closed sandergarretsen closed 10 years ago

sandergarretsen commented 10 years ago

"Since version 4.1.3, non-digested assets of ckeditor-rails will simply be copied after digested assets were compiled."

I read the closed issues about the asset-pipeline in rails4 and Eric's solution. Is this the reason why the task takes about 5 minutes during every deploy?

tsechingho commented 10 years ago

I don't think so since the task of ckeditor-rails will check if the old one exists or expires. https://github.com/tsechingho/ckeditor-rails/blob/master/lib/ckeditor-rails/tasks.rake#L9 And the copy process is very fast action.

It might be some other compile processes taking your time on each deploy.

stlewis commented 10 years ago

I'm having a similar issue -- asset precompilation is taking a very long time, and the hangs are clearly on pieces of the ckeditor code. One thing that might help would be the ability to limit what is included in the ckeditor install so that we're not having to precompile too much if we don't need to?

sandergarretsen commented 10 years ago

I'm also pretty sure that this gem is causing my problems. When I add this gem, assets:precompile takes about 12 minutes. When I remove it, it's just a couple of seconds.

I'm not experienced enough to say if this is normal behavior or not. But it seems long to me...

Probably it's not really the gem causing it, but just the consequence of adding this many files to the asset pipeline?

terenceponce commented 10 years ago

I'm having the same issue right now and I'm pretty sure this gem is what made the precompilation very slow. It has almost been 30 minutes since I deployed to Heroku and it still hasn't finished yet. I'll try to use an older version and let you know what I find.

gcapizzi commented 10 years ago

Same here, it's taking a long time compiling all files under ckeditor/lang (and I don't need to support all those languages). Any way to avoid this?

tsechingho commented 10 years ago

This is my today's deploy log of capistrano 3. It's not fresh deployment. it's deployed to my own machine, not heroku, not virtual machine in laptop.

https://gist.github.com/tsechingho/8949668

I can't repeat your situation.

gcapizzi commented 10 years ago

Maybe it's a problem with Heroku? I'll try to use turbosprockets.

sandergarretsen commented 10 years ago

Probably not, I have the same problem on my ubuntu-vps.

One thing I found out is that if I run the "rake assets:precompile" task manually, its very fast... Looks like I only have this problem when deploying with capistrano

sandergarretsen commented 10 years ago

Ok, I finaly found a solution for my problem. It had nothing to do with this gem but with my capistrano-rails configuration.

These posts helped me: https://github.com/capistrano/rails/issues/47 https://github.com/ndbroadbent/turbo-sprockets-rails3/issues/61

I did not symlink the tmp/cache directory in my deploy.rb. This configuration solved my problem:

set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/uploads public/assets}