JRuby语言:《JRuby语言实战技术》预计2008年6月出版

Posted by cnruby Mon, 26 May 2008 09:06:00 GMT

《JRuby语言实战技术》预计2008年6月出版




________________________________________________________________ 您只要点击下面图标,就可以把本文加入到您喜欢的公共收藏库中去。
del.icio.us Digg | FURL | Yahoo! My Web 2.0 | Reddit | Blinklist | Fark

Posted in

JRuby语言内部报道:CRuby语言和JRuby语言gem命令差异

Posted by cnruby Fri, 21 Mar 2008 20:14:00 GMT

JRuby语言内部报道:CRuby语言和JRuby语言的gem命令差异

  • 问题提出
    曾经在CRuby和JRuby语言中,命令gem install antwrap或者gem install Antwrap是一样的,但是现在JRuby语言不行了,这是因为它注意区分大小写了。
  • JRuby错误命令实例
    jruby -S gem install antwrap -r
    命令执行输出结果
    JRuby limited openssl loaded. gem install jruby-openssl for full support.
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
    ERROR:  could not find antwrap locally or in a repository
  • 解决方案
    jruby -S gem install Antwrap -r
    命令执行 输出结果
    JRuby limited openssl loaded. gem install jruby-openssl for full support.
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
    Successfully installed Antwrap-0.7.0-java
    1 gem installed
    Installing ri documentation for Antwrap-0.7.0-java...
    Installing RDoc documentation for Antwrap-0.7.0-java...
  • 参考资料
    http://www.hhtong.com/blog1/articles/2007/08/06/infoq-20070806-antwrap



________________________________________________________________ 您只要点击下面图标,就可以把本文加入到您喜欢的公共收藏库中去。
del.icio.us Digg | FURL | Yahoo! My Web 2.0 | Reddit | Blinklist | Fark

Posted in  | Tags , , ,

Ruby语言:Ruby程序运行外部程序(三)

Posted by cnruby Sat, 26 Jan 2008 21:53:00 GMT

Ruby语言:Ruby程序运行外部程序(三)

(.^.)说明:这是一个简单的Windows程序实例应用程序。在下面这个程序中,最后一行代码的函数不能使用Ruby语言的system函数。从中可以看到各种方法之间在不同的场合下存在的差异。

(.^.)在Windows系统下启动Rails应用程序的Ruby程序。
require 'Win32API'

def system(cmd)
  sys = Win32API.new "crtdll", "system", ['P'], 'L'
  sys.Call cmd
end

system("d: && cd D:\opt\rails-app && ruby script/server")



________________________________________________________________ 您只要点击下面图标,就可以把本文加入到您喜欢的公共收藏库中去。
del.icio.us Digg | FURL | Yahoo! My Web 2.0 | Reddit | Blinklist | Fark

Posted in  | Tags , , ,

Ruby语言:Ruby程序运行外部程序(二)

Posted by cnruby Fri, 25 Jan 2008 21:39:00 GMT

Ruby语言:Ruby程序运行外部程序(二)


(.^.)说明:这里主要说明面向操作系统的程序代码

(.^.)Windows操作系统
require 'Win32API' 
def system(cmd)
  sys = Win32API.new "crtdll", "system", ['P'], 'L'
  sys.Call cmd
end

system("del ./hello.txt")

(.^.)Linux操作系统程序一

require "Shell"

sh = Shell.new
sh.ls "-al ."
sh.cd "/opt/java"

(.^.)Linux操作系统程序二
require "Shell"

sh = Shell.new
sh.echo("puts 'Hello World!'") > hello.rb
sh.time("ruby hello.rb")




________________________________________________________________ 您只要点击下面图标,就可以把本文加入到您喜欢的公共收藏库中去。
del.icio.us Digg | FURL | Yahoo! My Web 2.0 | Reddit | Blinklist | Fark

Posted in  | Tags , , ,

Older Posts

Older Posts: 1 2 3 ... 9