免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3603 | 回复: 6
打印 上一主题 下一主题

[技巧]想知道Ruby运行在什么操作系统平台吗? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-12-21 09:49 |只看该作者 |倒序浏览
哈哈哈,今天来个简短点但很酷的技巧:想知道Ruby运行在什么操作系统平台吗?
那就是用RUBY_PLATFORM常量:


puts RUBY_PLATFORM
=> i486-linux

论坛徽章:
0
2 [报告]
发表于 2010-12-21 10:47 |只看该作者
其他预定义常量还包括:

TRUE              The typical true value.
FALSE             The false itself.
NIL               The nil itself.
STDIN             The standard input. The default value for $stdin.
STDOUT            The standard output. The default value for $stdout.
STDERR            The standard error output. The default value for $stderr.
ENV               The hash contains current environment variables.
ARGF              The alias to the $<.
ARGV              The alias to the $*.
DATA              The file object of the script, pointing just after __END__.
RUBY_VERSION      The ruby version string (VERSION was deprecated).
RUBY_RELEASE_DATE The release date string.
RUBY_PLATFORM     The platform identifier.

论坛徽章:
0
3 [报告]
发表于 2010-12-21 11:00 |只看该作者
祖儿补充得很多了。

论坛徽章:
0
4 [报告]
发表于 2010-12-24 20:19 |只看该作者
Ruby在ARM平台上编译也很方便

论坛徽章:
0
5 [报告]
发表于 2010-12-25 09:37 |只看该作者

论坛徽章:
0
6 [报告]
发表于 2011-02-22 19:24 |只看该作者

评分

参与人数 1可用积分 -4 收起 理由
2gua -4 灌水

查看全部评分

论坛徽章:
0
7 [报告]
发表于 2011-02-22 19:27 |只看该作者
ziyiu123 发表于 2011-02-22 19:24



    你已经灌了很多帖了,要注意。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP