Error Installing ruby runtime in Jenkins

10,293

Solution 1

It's a known bug. There is a workaround:

in /etc/default/jenkins

-Dhudson.ClassicPluginStrategy.noBytecodeTransformer=true 

JAVA_ARGS="$JAVA_ARGS -Dhudson.ClassicPluginStrategy.noBytecodeTransformer=true"

At the moment there is no definitive solution as you can see.

Solution 2

On Windows, Adding argument

-Dhudson.ClassicPluginStrategy.noBytecodeTransformer=true

in jenkins.xml file worked for me as @lvthillo stated.

<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -Dhudson.ClassicPluginStrategy.noBytecodeTransformer=true -jar "%BASE%\jenkins.war" --httpPort=8081 --webroot="%BASE%\war"</arguments>

Solution 3

I solved it by changing java version to 8th. Maybe there is a problem with java 11 compatibility issues. 1- https://www.liquidweb.com/kb/install-java-8-on-centos-7/

2- On Centos delete all ruby plugin in /var/lib/jenkins/plugins

3- download ruby-runtime.hpi plugin from https://updates.jenkins-ci.org/download/plugins/ruby-runtime/

4- Upload Plugin in jenkins /pluginManager/advanced.

Solution 4

On OSX I had to edit /Library/Application Support/Jenkins/jenkins-runner.sh

to add these lines at a point after javaArgs was defined

# workaround for ruby runtime install issue
# per http://stackoverflow.com/questions/33883551/error-installing-ruby-runtime-in-jenkins
javaArgs="$javaArgs -Dhudson.ClassicPluginStrategy.noBytecodeTransformer=true"

There is probably a more mac-ish way to do this.

Upon rebooting Jenkins, the ruby runtime plugin, which was already downloaded, started working, as did the also-downloaded rvm plugin, which is the one I was after.

Share:
10,293
Bluesea
Author by

Bluesea

Updated on July 25, 2022

Comments

  • Bluesea
    Bluesea almost 2 years

    I try to install ruby runtime, rvm, cucumber plugins in Jenkins,

    When I am installing ruby runtime plugin, I meet this error:

    java.io.IOException: Failed to dynamically deploy this plugin
        at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1328)
        at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1126)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
        at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: Failed to install ruby-runtime plugin
        at hudson.PluginManager.dynamicLoad(PluginManager.java:487)
        at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1324)
        ... 5 more
    Caused by: java.io.IOException: Failed to initialize
        at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:441)
        at hudson.PluginManager.dynamicLoad(PluginManager.java:478)
        ... 6 more
    Caused by: java.lang.ClassCircularityError: org/jruby/RubyClass
        at java.lang.Class.forName0(Native Method)
        ...
    

    How to fix it? Thanks in advance

    enter image description here

  • Bluesea
    Bluesea over 8 years
    Thank you so much! I installed Jenkins in windows. Where can I find these files? I just uploaded a screenshot of my Jenkins folder structure in the question above.
  • lvthillo
    lvthillo over 8 years
    I thinks it's jenkins.xml in Windows but I'm not sure (did not try it on windows). Sorry for the late reply.
  • kiltek
    kiltek over 8 years
    I am running Jenkins as a Tomcat war file. Where can i implement this workaround?
  • Saibamen
    Saibamen about 3 years
    This is not working for me :( Windows Server 2019 and Jenkins 2.277.1
  • Abhishek Dutt
    Abhishek Dutt over 2 years
    It should be ruby though.