Forum: Ruby on Rails Shelling out from an action with ``?

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.
Raymond B. (Guest)
on 2006-06-08 23:57
(Received via mailing list)
I'm trying to shell out (with the `` method, to call wget) from within
an action. It looks something like this:

  def prepare_project
    @project = Project.find_by_id(params[:id])"Exporting project...")
    `wget blah blah`
    `zip blah blah`
    flash[:notice] = "Exported project successfully."
    redirect_to :action => 'export_project', :id =>

The app hits this method and does indeed end up on export_project,
rendering that view... but it never seems to do the wget or zip stuff,
or even log! Can anyone please point me toward a solution?
Bryan D. (Guest)
on 2006-06-09 01:45
For starters, instead of using `wget` why not use Net::HTTP? It can do
the same thing, though maybe with a bit more work on your end.

As far as zipping goes, well, does anyone else know of a usable ruby-zip
library and can point out docs or a tutorial?
This topic is locked and can not be replied to.