Setting gems on jruby

I worked with ruby โ€‹โ€‹and ROR, but this new project requires me to use jruby. And I was given an ad with documentation, and he asks me to install jgem install cucumber, ect ..

I do this on Ubuntu 10.10

I do not understand the jgem part.

I did some research and tried to install it via: jruby -S gem install cucumber

and got the result:

 JRuby limited openssl loaded. gem install jruby-openssl for full support. http://jruby.kenai.com/pages/JRuby_Builtin_OpenSSL ERROR: While executing gem ... (SystemCallError) Unknown error - mkdir failed 

And I tried to install: gem install jruby-openssl and got the same results

+4
source share
2 answers

Sounds weird, how did you install JRuby? With RVM?

If you use rvm, it is very simple to install and use jruby, like all other Ruby implementations.

 rvm install jruby rvm use jruby jruby -v gem install jruby-openssl 
+4
source

These are steps showing how to package bio and jruby-openssl in jruby-complete-1.6.7.jar, becoming biojruby.jar (just for my purpose I need bioruby to develop bioinformatics programs)

Here are the steps:

  • Make sure you go to the directory containing jruby-complete-1.6.7.jar in the terminal / console

  • In the terminal / console, enter:

     mkdir biojruby 
  • Just add any gems you want, for gems that are written exclusively in ruby โ€‹โ€‹without the C extension will work in Jruby!

     java -jar jruby-complete-1.6.7.jar -S gem install -i ./biojruby bio java -jar jruby-complete-1.6.7.jar -S gem install -i ./biojruby jruby-openssl jar uf jruby-complete-1.6.7.jar -C biojruby . mv jruby-complete-1.6.7.jar biojruby.jar 
  • Now you can delete the biojruby folder

  • Done!

Now enter:

 java -jar biojruby.jar -S gem list 

and you will see (indicate success):

 **** LOCAL GEMS *** bio (1.4.2) bouncy-castle-java (1.5.0146.1) jruby-openssl (0.7.6.1) rake (0.8.7) sources (0.0.1)* 

Now you can test your ruby โ€‹โ€‹script by type in:

 java -jar biojruby.jar #Your_Ruby_Script.rb# 
+5
source

Source: https://habr.com/ru/post/1382393/


All Articles