I am looking to get CruiseControl.rb to operate rcov throughout a build. It's presently failing using the following error:

sh: rcov: not found 

Since I Have can run rcov in the spend after i sign in, I figure that this can be a PATH problem. (Furthermore, I'm able to run both rake test:rcov and rake cruise in the spend without errors). I added a p 'echo $PATH' statement (using the correct backticks to complete the command thanks Markdown) to my cruise.rake and learned that the road was indeed incorrect:


The rcov executable reaches /var/lib/gems/1.8/bin/rcov, therefore it is no surprise that CC.rb aren't able to find it.

However, I can not learn how to set the road correctly. I've this set at the end of my .profile:


This is exactly what causes it to be work interactively, but it is not acquired by CC.

I am running CruiseControl.rb under Passenger Phusion (and therefore under apache). I have checked as numerous files when i can think about, but nothing appears like a Road to me.

How can i set the road and/or determine in which the path has been set?

To begin with, your .profile is wrong. You have to export the atmosphere variable of all time visible with other processes. Such as this:

export PATH=....


export PATH

Non-released atmosphere variable values are only able to be utilized from inside exactly the same spend process.

But that is not your condition since you are running Phusion Passenger. .profile is just read through the spend, and also, since Apache isn't began in the spend, but in the system init process, whatever you devote .profile is overlooked. For Phusion Passenger you need to set the journey with mod_env and also the SetEnv directive, such as this:

<VirtualHost *:80>
    ServerName something.test
    DocumentRoot /somewhere/to/cruisecontrol/public
    SetEnv PATH /usr/bin:/usr/local/bin:/bin:/var/lib/gems/1.8/bin    # <---- add this

I finally got everything working.

First of all, @Hongli's assistance with setting the road within Apache was correct SetEnv could set the road for that Passenger-based site.

After digging around with the CruiseControl.rb code I came across the secondary problem (that I alluded during my comments to Hongli's answer). Throughout startup, CC.rb forks a builder process for every project. Each process will get the road of their parent at that time it had been produced. My problem was which i was restarting Apache, but this wasn't restarting the builder processes for reasons uknown. The contractors thus did not get my PATH updates, and thus made an appearance not receiving the road from Apache. That brought me to think their Pathways were set elsewhere -- but this isn't the situation.

Restarting the machine have been effective the brand new contractors got the brand new PATH from Apache and today everything works not surprisingly. There's most likely another method to restart the contractors, however i haven't looked into that.