Skipping asset:precompile for our deployed development environment

38 views
Skip to first unread message

Tom Harrison

unread,
Jan 7, 2015, 10:52:00 AM1/7/15
to capis...@googlegroups.com
Versions:
  • Ruby: 2.1
  • Capistrano: 3.1
  • Rake / Rails / etc: 4.1
Platform:
  • Working on....: OS X
  • Deploying to...: CentOS
We have a development environment that is not local (we call it "remotedev"), and have been deploying to it.  But we want it to be like a local dev environment, in particular not using the assets pipeline.

I am pretty sure I have the config/remotedev.rb configured in such a way that Rails should not use the assets pipeline.  But assets are not loading (no images, css, etc.) ... I am trying to prevent asset precompile in the hope that this will allow Rails to do its normal development thing.

How can I conditionally suppress asset precompilation in Cap 3?

Thanks!

Tom

Lee Hambley

unread,
Jan 7, 2015, 11:09:00 AM1/7/15
to capistrano
Hi Tom,


However you can still make Rails always compile assets, somehow as far as I remember, even if the static ones are there. 

As a worst-case, you could configure rails to serve assets from their sources files (i.e not pre compiled) and simply add your own task to delete the compiled assets in that particular environment.

Definitely sub-optimal, but also you could probably send a PR to the capistrano/rails maintainers, or even replace this task with your own implementation. Note, a lot of people struggle with this, but this increasingly old gem clears up the behaviour of all the rake task override stuff http://blog.jayfields.com/2008/02/rake-task-overwriting.html

--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/30d86f38-1ea1-4875-97d0-c3f296d49ef2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Harrison

unread,
Jan 7, 2015, 2:18:06 PM1/7/15
to capis...@googlegroups.com
Thanks, Lee

I spent some quality time with asset pipeline only to realize the problem had nothing to do with what I thought, but was simply a bug that appeared when assets were compiled.  Grumble :-)

Thanks for the link on overriding rake tasks -- didn't know about this.

I'll see if I can find a tiny bit of code needed to support disabling asset pre-compiling per environment and do a PR for the maintainers.

Thanks for your help, as always.

Tom
Reply all
Reply to author
Forward
0 new messages