Forum: Ruby on Rails Running assets:precompile inside my rails app

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3b8ad006781b1a3ab36dc76e2a05ce9c?d=identicon&s=25 Cris Shupp (cshupp)
on 2016-12-08 19:10
Hi Rubyists,

Application A, a rails app, is responsible for deploying application B,
also a rails app.  Application B's war file (JRuby) will be seeded with
a file called context.txt at the root of the war file.

context.txt might have a one liner like:

/app_b

I need, in application B's initializer, for it to run assets:precompile.
This cannot be done in advance as the user in application A will end up
choosing a context from a list of contexts preconfigured to work with
our apache mod_proxy server.

So if I have (in config/initializers/z_last.rb)

load 'Rakefile'
Rake::Task["assets:precompile"].invoke

It would be nice if all the assets are compiled (they aren't -- only
.sprockets-manifest)

production.rb would have:

 config.relative_url_root = $context #from file

Thanks,

Cris
This topic is locked and can not be replied to.