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

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.
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])
    logger.info("Exporting project...")
    `wget blah blah`
    `zip blah blah`
    flash[:notice] = "Exported project successfully."
    redirect_to :action => 'export_project', :id => @project.id
  end

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.