cannot convert instance of class org.jruby.RubyException to class java.lang.Throwable
sandeepbalouria opened this issue · comments
Hi
I am having this issue .
https://issues.jenkins-ci.org/browse/JENKINS-24232
I clone the master and trying to build but it is failing . I am not a ruby guy so having troubles.
bundle install
jpi build
running above commands give me this
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in require': cannot load such file -- java (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in
require'
from /Library/Ruby/Gems/2.0.0/gems/jpi-0.4.0/lib/jenkins/plugin/tools/bundle.rb:12:in install' from /Library/Ruby/Gems/2.0.0/gems/jpi-0.4.0/lib/jenkins/plugin/tools/package.rb:23:in
build'
from /Library/Ruby/Gems/2.0.0/gems/jpi-0.4.0/lib/jenkins/plugin/cli.rb:35:in build' from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in
run'
from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command' from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in
dispatch'
from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in start' from /Library/Ruby/Gems/2.0.0/gems/jpi-0.4.0/bin/jpi:6:in
<top (required)>'
from /usr/bin/jpi:23:in load' from /usr/bin/jpi:23:in
Any help would be appreciated.
Hi @sandeepbalouria!
I've tried building from master and it looks OK from my side.
This is the output of jpi build
:
bundling...
Using diff-lcs 1.2.5
Using json 1.7.5
Using slop 3.0.4
Using jenkins-plugin-runtime 0.2.3
Using rack 1.4.1
Using rack-protection 1.2.0
Using rspec-support 3.0.2
Using rspec-core 3.0.2
Using rspec-expectations 3.0.2
Using rspec-mocks 3.0.2
Using rspec 3.0.0
Using tilt 1.3.3
Using sinatra 1.3.3
Using bundler 1.6.3
Your bundle is complete!
Gems in the group development were not installed.
It was installed into ./pkg/vendor/gems
gitlab-hook plugin 1.1.0 built to pkg/gitlab-hook.hpi
I am using java:
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
And jruby:
jruby 1.7.9 (1.9.3p392) 2013-12-06 87b108a on Java HotSpot(TM) 64-Bit Server VM 1.7.0_45-b18 [linux-amd64]
Jpi version:
0.4.0
Hope this helps...
This i smy setup:
jpi --version
0.4.0
java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
jruby 1.7.13 (1.9.3p392) 2014-06-24 43f133c on Java HotSpot(TM) 64-Bit Server VM 1.7.0_67-b01 [darwin-x86_64]
what should be the sequence of command to be run once i cd to project dir.
bundle install
also tried (jruby -S bundle install)
jpi build
it is failing out on this /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb
shouldn't it go to jruby??
Yep, the sequence of commands and the versions are OK.
You might also try bundle exec jpi build
. This will ensure you're using correct gem version.
Also, check ruby -v
, it should report back jruby.
I use https://github.com/sstephenson/rbenv for handling ruby versions per project, if it helps.
Hi @elvanja
Thanks Man! i was able to build it i used this command to build.
jruby -S jpi build
I installed it and the hook worked!
Thanks again.
Cool, glad to have helped :-)