Hi,
I want to include net/ssh gems to the main jar file in jruby. So that at
client side it does not required to install net/ssh gems.
Please guide me how I can do it in my project. I am using netbeans as
editor.
Thanks
Khirod
Hi,
I want to include net/ssh gems to the main jar file in jruby. So that at
client side it does not required to install net/ssh gems.
Please guide me how I can do it in my project. I am using netbeans as
editor.
Thanks
Khirod
I believe there are JRuby wiki articles about this, but there’s a couple
ways:
I believe there are JRuby wiki articles about this, but there’s a couple
ways:
Thanks Charlie for your response.
I tried to create jar for net-ssh gems. I followed the below steps.
java -jar jruby-complete-1.6.7.2.jar -S gem install -i ./net-ssh net-ssh
jar -cf net-ssh-gems.jar net-ssh .
doubt here : How can I use this jar file in my program. and how can it
get the dependencies required for net-ssh.
My Last attempt command are follows :
jruby -S gem install -i ./net-ssh net-ssh --no-rdoc --no-ri
jar uf jruby-complete-1.6.7.2.jar -C net-ssh .
java -jar jruby-complete-1.6.7.2.jar -S gem list
*** LOCAL GEMS ***
jruby-pageant (1.1.1 java)
net-ssh (2.5.2)
rake (0.8.7)
sources (0.0.1)
So here it show the gems net-ssh, but… when I checked the the gems
through irb net-ssh throws error does not exists i.e.
irb(main):006:0> require ‘rubygems’
=> true
irb(main):007:0> require ‘rake’
=> true
irb(main):008:0> require ‘sources’
=> true
irb(main):009:0> require ‘net-ssh’
LoadError: no such file to load – net-ssh
from org/jruby/RubyKernel.java:1033:in require' from file:/E:/jruby-1.6.7.2/lib/gems/jruby-complete-1.6.7.2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
require’
from (irb):9:in evaluate' from org/jruby/RubyKernel.java:1083:in
eval’
from
file:/E:/jruby-1.6.7.2/lib/gems/jruby-complete-1.6.7.2.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:158:in
eval_input' from file:/E:/jruby-1.6.7.2/lib/gems/jruby-complete-1.6.7.2.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:271:in
signal_status’
from
file:/E:/jruby-1.6.7.2/lib/gems/jruby-complete-1.6.7.2.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:155:in
eval_input' from org/jruby/RubyKernel.java:1410:in
loop’
from org/jruby/RubyKernel.java:1183:in catch' from file:/E:/jruby-1.6.7.2/lib/gems/jruby-complete-1.6.7.2.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:154:in
eval_input’
from
file:/E:/jruby-1.6.7.2/lib/gems/jruby-complete-1.6.7.2.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:71:in
start' from org/jruby/RubyKernel.java:1183:in
catch’
from
file:/E:/jruby-1.6.7.2/lib/gems/jruby-complete-1.6.7.2.jar!/META-INF/jruby.home/lib/ruby/1.8/irb.rb:70:in
start' from E:/jruby-1.6.7.2/bin/jirb:13:in
(root)’
irb(main):010:0>
-Khirod
Khirod Patra wrote in post #1065293:
Hi,
I want to include net/ssh gems to the main jar file in jruby. So that at
client side it does not required to install net/ssh gems.Please guide me how I can do it in my project. I am using netbeans as
editor.Thanks
Khirod
Perhaps it would be easier to work with the “normal” version of JRuby
rather than the .jar version. If you use the normal version “gem install
xxx” puts the gems within the JRuby directory structure. You can then
.zip the whole lot and distribute that. As far as I can see the zipped
version will be as small as the .jar version.
I solved it :
The problem was with the dependencies
for net-ssh it required :
jruby-openssl
jruby-peagant
So finally :
jruby -S gem install -i ./net-ssh net-ssh --no-rdoc --no-ri
jruby -S gem install -i ./jruby-openssl jruby-openssl --no-rdoc --no-ri
jruby -S gem install -i ./jruby-peagant jruby-peagant --no-rdoc --no-ri
jar uf jruby-complete-1.6.7.2.jar -C jruby-openssl.
jar uf jruby-complete-1.6.7.2.jar -C jruby-peagant .
jar uf jruby-complete-1.6.7.2.jar -C net-ssh .
java -jar jruby-complete-1.6.7.2.jar -S gem list
java -jar jruby-complete-1.6.7.2.jar -S irb
irb> require ‘rubygems’
=>true
irb> require ‘net/ssh’
=>true
That’s It …
-Khirod
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs