Jenkins using System Ruby - use rvm ruby?

天大地大妈咪最大 提交于 2019-12-13 07:04:05

问题


Jenkins is kindly running an Ant build for us. The Ant build orchestrates CI for an Objective-C project - a library that is available on both iOS and OSX.

This Ant build can be run both in or out of Jenkins, so devs can verify their work before checking in, and Jenkins will provide another layer of checks. (Therefore reducing the chance of a broken build impacting other contributors).

I've created a task that does the following:

<target name="--podspec.lint">
    <exec executable="pod" failifexecutionfails="yes" failonerror="yes">
        <arg line="spec lint ProjectName.podspec"/>
    </exec>
</target>

. . it seems that Jenkins is using the System Ruby, even though the machine has RVM installed. Is there a way to tell Jenkins to use the rvm version? This seems like a path problem - the sytem bin dirs have moved the the front of the path, even though RVM takes precedence in the .profile.


回答1:


This tutorial should have everything you need. It is written for Ubuntu, but you should be able to do something analogous for your OS if it differs.

The main thrust is that you need to configure a jenkins user and then setup rvm for that jenkins user.



来源:https://stackoverflow.com/questions/20624324/jenkins-using-system-ruby-use-rvm-ruby

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!