Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Installing ruby runtime in Jenkins

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

like image 704
Bluesea Avatar asked Nov 24 '15 00:11

Bluesea


3 Answers

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.

like image 193
lvthillo Avatar answered Nov 14 '22 19:11

lvthillo


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>
like image 25
Shubham Khandare Avatar answered Nov 14 '22 20:11

Shubham Khandare


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.

like image 1
Dave Hildebrandt Avatar answered Nov 14 '22 19:11

Dave Hildebrandt