Help.I am in need of using a ruby script for my website.I am very new to ruby, and I only need to use single gem(anystyle-parser) for my ruby script, and so I decided to use php to create the website.
My PHP code :
<?php
if (isset($_POST["ref"])) {
$reference=$_POST["ref"];
echo "OUTPUT :";
echo "<br>";
$cmd="ruby test.rb ".escapeshellarg($reference);
echo system($cmd);
}
else
{}
My ruby code :
require 'anystyle/parser'
require 'rubygems'
ref=ARGV[0]
s=Anystyle.parse ref
puts s
Gem requirements:
anystyle/parser
The value from PHP code is getting passed to the ruby script(through escapeshellarg),but it does not seem to execute the function of the 'anystyl-parser' gem.
How do I create a link between the apache localhost server and the rubygems?
The ruby script script works fine in the terminal.But it is not working ,when called through the php(in the localhost).