You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 16, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 16, 2024. It is now read-only.
$ ls
app config db Gemfile.lock log Rakefile test vendor
bin config.ru Gemfile lib public README.rdoc tmp
$ test -f Rakefile && (test "$(bundle exec rake -T | grep assets:precompile)"&& bundle exec rake assets:precompile)
I, [2015-10-01T18:41:24.746492 #2063] INFO -- : Writing /home/george/workspace/tests/ruby/railsblocks/myproject/public/assets/application-d4d603d0ff049a3ecfbf019b468bf1a62a50b9fdafe41213c300fa071342b600.js
I, [2015-10-01T18:41:24.749187 #2063] INFO -- : Writing /home/george/workspace/tests/ruby/railsblocks/myproject/public/assets/application-e80e8f2318043e8af94dddc2adad5a4f09739a8ebb323b3ab31cd71d45fd9113.css
@3den My rake-fu is not super strong, but the first section here talks about how to build dependency tasks. You'll have to build a custom task for the bower install part, I found an overly complicated example here, but you should be able to pull out the useful bits.
Because assets:precompile is built in to rails, or so I believe, you might have to do some googling around how to customize that task. It's probably not that difficult though.
Activity
jmervine commentedon Aug 18, 2015
That's pretty hacky though.
hone commentedon Aug 26, 2015
Yeah, if it fails it should break building if you expect it to run.
jmervine commentedon Aug 26, 2015
Right, so you need to grep the output and return true if there's no task and false if there is... Ugly.
gwmoura commentedon Sep 30, 2015
guys, I test this:
and work for me. I tested using an simple script with Gemfile without rails or sinatra, only ruby
jmervine commentedon Sep 30, 2015
@gwmoura I can see quite a few use-cases were an app would have a
Rakefilewithoutassets:precompile... how about...gwmoura commentedon Sep 30, 2015
@jmervine yes, can be, in my case, I execute a ruby script only, no Rails. Your solution not work for me :(
jmervine commentedon Sep 30, 2015
@gwmoura Merging the two, you could do something like (untested):
gwmoura commentedon Oct 1, 2015
@jmervine I tested your script and this worked fine for me. @hone if you want, you can add on Dockerfile.
I tested locally, but I will add in my image based on
heroku/rubyLook my results:
And in a rails app too not work
3den commentedon Apr 20, 2016
why cant we just remove the assets:precompile from this Docker file and have users add it if needed?
3den commentedon Apr 20, 2016
even with the suggested fix it would not work for my team because we need to run
bower installbefore theassets:precompile.jmervine commentedon Apr 20, 2016
@3den Perhaps add
bower installas a pre-req task toassets:precompile?3den commentedon Apr 20, 2016
@jmervine thanks for the reply, what is the best way to do that?
jmervine commentedon Apr 20, 2016
@3den My rake-fu is not super strong, but the first section here talks about how to build dependency tasks. You'll have to build a custom task for the
bower installpart, I found an overly complicated example here, but you should be able to pull out the useful bits.Because
assets:precompileis built in to rails, or so I believe, you might have to do some googling around how to customize that task. It's probably not that difficult though.Cheers!
Edit: This talks about how to do exactly what we're talking about here. I didn't vet it, but it should be a good start.