论坛首页 编程语言技术论坛

欢迎进入JRuby on Rails的世界

浏览 13951 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (2) :: 隐藏帖 (0)
作者 正文
   发表时间:2008-11-29   最后修改:2008-11-29

      JRuby 1.1.5 发布不久后,重量级的Rails 2.2.2 终于发布了。对于JRuby on Rails fans来说,要多多感谢Josh Peek和Nick Sieger,现在Rails也是安全线程的啦。闲话少说,现在跟着我一起安装JRuby on Rails吧。

      第一步 ,下载最新的JRuby二进制版本,解压缩到你的硬盘(本例子为E盘)。好了,你的JRuby就装好了!那么快?是的,来个经典的Hello World 试一试吧。输入——E:\jruby\bin\jruby -e "puts 'Hello World'"

      第二步 ,为了避免重复输入这些长长的路径,可以设置系统变量。如下图:

 


    第三步 ,安装RubyGems。在RubyGems解压缩后的文件夹内,运行命令:jruby -S setup.rb


    第四步 ,运行命令:jruby –S gem install jruby-openssl

 

    第五步 ,开始安装Rails。运行命令:jruby –S gem install rails

 


    第六步 ,安装jdbcmysql

  • 大小: 102.4 KB
  • 大小: 55.4 KB
  • 大小: 34 KB
  • 大小: 84.7 KB
  • 大小: 80.9 KB
   发表时间:2008-11-29  
能简单介绍一下,jruby和ruby有什么区别嘛?
0 请登录后投票
   发表时间:2008-11-30   最后修改:2008-11-30
tangyuanjian 写道
能简单介绍一下,jruby和ruby有什么区别嘛?


我认为,下面这段英文的简介描述是非常恰当的——
JRuby is an open source implementation of the Ruby programming language for the Java Virtual Machine (JVM). It allows Ruby applications to be run within a Java Virtual Machine and interface with libraries written in either Java or Ruby. With the release of JRuby 1.1 in April 2008, JRuby has closed the performance gap with the C Ruby interpreter and is in many cases faster. In terms of compatibility, the JRuby project strives to duplicate the behavior of the standard Ruby interpreter whenever possible, even at the expense of consistency with Java. Most of the core Ruby classes are included, as is much of the standard Ruby library, the RubyGems package management system, RDoc documentation support, and the Rake build system. Despite these efforts at compatibility, there are some areas where JRuby deviates from behavior exhibited by the C Ruby interpreter. The most visible example of this is how JRuby handles threads. In this case, however, JRuby is actually ahead of the standard Ruby interpreter in that Ruby 2.0 is expected to have a similar threading model to what JRuby already supports.
0 请登录后投票
   发表时间:2008-11-30  
JRuby要紧跟ruby标准会很累的, 随着ruby虚拟机的成熟, 没必要在JVM中跑ruby?!
0 请登录后投票
   发表时间:2008-11-30  
可以打着java旗号去忽悠领导,速度未必有优势
0 请登录后投票
   发表时间:2008-11-30  
sw2wolf 写道
JRuby要紧跟ruby标准会很累的, 随着ruby虚拟机的成熟, 没必要在JVM中跑ruby?!

有的,绝对有必要,JRuby中可以让ruby无缝的调用Java现成的库。
目前Ruby和python比缺陷之一就是库还是太少,SciPy这些库让人流口水。有了JRuby,就不是ruby一个语言在战斗!
0 请登录后投票
   发表时间:2008-11-30  
感觉ruby的插件还是比较丰富!
0 请登录后投票
   发表时间:2008-12-01  
jruby的目的之一就是与丰富的java库和平台进行无缝衔接,同时又具备ruby语言的灵活性,我很看好。
0 请登录后投票
   发表时间:2008-12-01  
我认为,JRuby 的最大好处就是,告诉你的客户,我的系统还是Java 的
你要是说你用ruby 开发系统,好多单,连投标资格都没有
0 请登录后投票
   发表时间:2008-12-01  
jruby还有一个好处,可以自己对ruby代码做加密,只要修改一下jruby的
/org/jruby/lexer/yacc/ByteListLexerSource.java
就可以了
0 请登录后投票
论坛首页 编程语言技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics