简体   繁体   English

在jruby上安装宝石

[英]Installing gems on jruby

I've worked with ruby, and ROR but this new project is requiring me to use jruby. 我曾与ruby和ROR合作,但这个新项目要求我使用jruby。 And I have been given documentation ad it is asking me to install jgem install cucumber, ect.. 我得到了文档广告,它要求我安装jgem安装黄瓜,等..

I am doing this on Ubuntu 10.10 我在Ubuntu 10.10上这样做

I don't understand the jgem part. 我不明白jgem部分。

I Did some research and tried to install it via: jruby -S gem install cucumber 我做了一些研究并尝试通过以下方式安装它: jruby -S gem install cucumber

and got the output: 得到了输出:

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 我尝试安装: gem install jruby-openssl并得到了相同的结果

These are the steps showing how to pack bio and jruby-openssl into jruby-complete-1.6.7.jar becoming biojruby.jar (just for my purpose, I need bioruby for developing bioinformatics programs) 这些是显示如何将biojruby-openssl打包成jruby-complete-1.6.7.jar成为biojruby.jar (仅为了我的目的,我需要bioruby来开发生物信息学程序)

Here are the steps: 以下是步骤:

  • Make sure you navigated into the directory containing jruby-complete-1.6.7.jar in terminal/console 确保导航到终端/控制台中包含jruby-complete-1.6.7.jar的目录

  • In terminal/console, type in: 在终端/控制台中,输入:

     mkdir biojruby 
  • Just add any gems you want, for gems which written purely in ruby without any C extension will work in Jruby! 只需添加你想要的任何宝石,对于纯粹用红宝石编写而没有任何C扩展名的宝石将在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 remove the folder "biojruby" 现在你可以删除文件夹“biojruby”

  • Completed! 已完成!

Now type in: 现在输入:

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 with your ruby script by type in: 现在,您可以通过键入以下内容来测试ruby脚本:

java -jar biojruby.jar #Your_Ruby_Script.rb#

It sounds strange, how have you installed JRuby? 听起来很奇怪,你是如何安装JRuby的? With RVM? 使用RVM?

If you use rvm it's super easy to install and use jruby like every others ruby implementation. 如果你使用rvm它的安装非常容易,并且像其他所有ruby实现一样使用jruby。

rvm install jruby
rvm use jruby

jruby -v
gem install jruby-openssl

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM