Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-39193

Unable to use rbenv plugin together with ruby environment plugin

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • job-dsl-plugin
    • None

      Hi,

      I am trying to use a simple rbenv wrapper, the settings will be set in config.xml of the job, but neither the UI is picking them up, nor the build itself.

      This is the code I am using:

              job.wrappers {
                  rbenv(rubyVersion) {
                      ignoreLocalVersion()
                      gems('bundler', 'rake')
                  }
              }
      

      The settings will be transferred into the config.xml of the job:

      <buildWrappers>
      <ruby-proxy-object>
      <ruby-object ruby-class="Jenkins::Tasks::BuildWrapperProxy" pluginid="rbenv">
      <pluginid ruby-class="String" pluginid="rbenv">rbenv</pluginid>
      <object ruby-class="RbenvWrapper" pluginid="rbenv">
      <version ruby-class="String" pluginid="rbenv">1.9.3-p551</version>
      <ignore__local__version ruby-class="String" pluginid="rbenv">true</ignore__local__version>
      <gem__list ruby-class="String" pluginid="rbenv">bundler,rake</gem__list>
      <rbenv__root ruby-class="String" pluginid="rbenv">$HOME/.rbenv</rbenv__root>
      <rbenv__repository ruby-class="String" pluginid="rbenv">https://github.com/sstephenson/rbenv.git</rbenv__repository>
      <rbenv__revision ruby-class="String" pluginid="rbenv">master</rbenv__revision>
      <ruby__build__repository ruby-class="String" pluginid="rbenv">https://github.com/sstephenson/ruby-build.git</ruby__build__repository>
      <ruby__build__revision ruby-class="String" pluginid="rbenv">master</ruby__build__revision>
      </object>
      </ruby-object>
      </ruby-proxy-object>
      </buildWrappers>
      

      But the UI is not picking them up (the checkbox for rbenv build wrapper is unchecked) and the settings are not transferred into the block.

      When I manually setup the wrapper the xml looks like this:

      <buildWrappers>
      <ruby-proxy-object>
      <ruby-object ruby-class="Jenkins::Tasks::BuildWrapperProxy" pluginid="rbenv">
      <pluginid ruby-class="String" pluginid="rbenv">rbenv</pluginid>
      <object ruby-class="RbenvWrapper" pluginid="rbenv">
      <version ruby-class="String" pluginid="rbenv">1.9.3-p551</version>
      <ignore__local__version ruby-class="String" pluginid="rbenv">true</ignore__local__version>
      <gem__list ruby-class="String" pluginid="rbenv">bundler,rake</gem__list>
      <rbenv__root ruby-class="String" pluginid="rbenv">$HOME/.rbenv</rbenv__root>
      <rbenv__repository ruby-class="String" pluginid="rbenv">https://github.com/sstephenson/rbenv.git</rbenv__repository>
      <rbenv__revision ruby-class="String" pluginid="rbenv">master</rbenv__revision>
      <ruby__build__repository ruby-class="String" pluginid="rbenv">https://github.com/sstephenson/ruby-build.git</ruby__build__repository>
      <ruby__build__revision ruby-class="String" pluginid="rbenv">master</ruby__build__revision>
      </object>
      </ruby-object>
      </ruby-proxy-object>
      </buildWrappers>
      

      I cannot stop the difference. The error goes away when using ruby env 0.12.

            daspilker Daniel Spilker
            bjoernhaeuser Björn Häuser
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: