Forum: Ruby on Rails run rake task inside rails application

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
kingston.s (Guest)
on 2014-01-30 14:54
(Received via mailing list)
Hi all,

I want to run asset precompile task inside the rails application,As I
many dependencies who will change the code,in that case all the time
whenever they change i need to run the script as I cant give server
to them so I am providing the GUI for them from that they alone can run
script,so,I have built UI to run the task with some parameter like

     system("Template='#{params[:template]}' Theme='#{params[:theme]}'
rake assets:precompile)

I am getting two values from
thing i want to run this task in another path(site path) means Admin
UI is there that task should execute in Site directory,

 Dir.chdir "#{SITEPATH}" do
     `Template="small_business_1" Theme="1" rake assets:precompile`
      # system("Template='small_business_1' Theme='1' rake

I have tried this code by putting in controller and lib, but this is not

I have tried with shell script also.

Could please anyone can help me.

This topic is locked and can not be replied to.