I'm setting up my first Ruby project on Team City, which is hosted on a Windows Server, but I'm having a problem. Now, because the server may not have the required gems installed, I've added a command line build step:
bundle install
Now I thought this would be enough, but apparently bundle
is not recognized as an internal or external command. Except, if I RDP into the server, if I run bundle install
from anywhere, it is fine, and just notifies me that no gemfile was found.
Any ideas on if I've missed a step, or I'm going about this the wrong way?
Most likely this is a problem with TeamCity not finding the path to ruby executables.
You can address this by overriding the value to the PATH environment variable in your build configuration in the Build Parameters section.
See this answer for the proper links to documentation, etc.
EDIT #1
I noticed when updating one of my configurations that TeamCity is supposed to take care of appending values so you DO NOT need to set path equal to itself. The post mentioned above is a workaround for a bug where TeamCity was overwriting the values, but that has been corrected. See the help at the mouse-over for more information:
EDIT #2
I tested edit #1 and found that is not the case. You do need to
env.Path
C:\Program Files\MySQL\MySQL Server 5.6\bin\;%env.Path%
env.Path=...
as listed above; that is what the configuration file will look like.I tested this out by doing the following:
mysql --help
This will fail if it cannot find MySqlI then ran it for each of the following settings for the
env.Path
variable:C:\Program Files\MySQL\MySQL Server 5.6\bin\
. TeamCity reports out only that entry.C:\Program Files\MySQL\MySQL Server 5.6\bin\;%env.Path%
. TeamCity prependsC:\Program Files\MySQL\MySQL Server 5.6\bin\
to the build agent's values shown in #1. The result is what we want, #1 + #2