I am trying to execute a linux command from inside my controller. It
works on my development machine, but does not work in production. Here
is the code.
def get_whois @the_site = Site.find_by_id(params[:id])
unless @the_site
flash[:error] = “Site could not be found”
redirect_to :action => :index and return
end @the_site.whois = whois #{@site.domain} @the_site.save
flash[:notice] = “WHOIS information captured”
redirect_to :action => :show, :id => @the_site.id
end
Does anyone know why this doesn’t work in production mode? It works
fine in development…
flash[:error] = “Site could not be found”
redirect_to :action => :index and return
end @the_site.whois = whois #{@site.domain} @the_site.save
flash[:notice] = “WHOIS information captured”
redirect_to :action => :show, :id => @the_site.id
end
Does anyone know why this doesn’t work in production mode? It works
fine in development…
I suspect it’s very unlikely that this is the issue but the first
thing that popped into my head was whether it’s running as a different
user in production, with a different path.
David
–
Rails training from David A. Black and Ruby Power and Light:
Intro to Ruby on Rails July 21-24 Edison, NJ
Advancing With Rails August 18-21 Edison, NJ
Co-taught by D.A. Black and Erik Kastner
See http://www.rubypal.com for details and updates!
I suspect it’s very unlikely that this is the issue but the first
thing that popped into my head was whether it’s running as a different
user in production, with a different path.
David
Hey David –
Hmm… if that was the problem, then how should I change it so it works?
What else could be causing it to work in development, but not
production?
@the_site.whois = whois #{@site.domain} @the_site.save
flash[:notice] = “WHOIS information captured”
redirect_to :action => :show, :id => @the_site.id
end
Do you get an error? What is the error?
Does the production machine even have that command available?
Since whois connects to external servers, do you know if that connection
is allowed (i.e. is there a firewall or some other network filtering
going
in?).