Fair warning; I don't even really know Ruby. I'm just hacking together some scripts that I was given and hoping they'll work together.
Background
I'm using Ruby to automate several tasks as an svn administrator, and one of the tasks that I'm trying to effect is making a web-form that will automate the creation of a repository.
The script I'm running is about 100-200 lines total, including the includes and things like that. I'm sure there will be other problems with the code, but presently, it's running into one problem.
The Ruby script itself works. My problem is that it doesn't work when I try to call it from a PHP script in a different directory.
The directory structure is like this:
Home
.www-docs
makeRepo.php
svn
createNewRepo.php
migrateOne.php // This has yet to cause a problem
RepoUtils.rb // Not currently causing a problem
Problem
The exact problem that I'm running into is that the Ruby script stops executing (and doesn't print an error message that I can echo in the PHP at a particular point in the code.
I'm calling the script as follows:
chdir("../svn");
echo exec("ruby createNewRepo.rb $name1 $name2 $num")
So, it's definitely calling the script. I put print points throughout the script, so I know it stops around here:
print "Point 1"
acl = File.new(@@aclfile, "a")
print "Point 2"
@@aclfile is an absolute path, not relative, so I don't think that alone is the problem.
The above code will end up printing Point 1 (and nothing that comes after that, either).
What am I doing wrong?
Thanks!
chdir('..svn')is suspect. That should bechdir('../svn')if this is your real code.