Ruby 程序员的挚友
历史背景[1]
诞生于1993年2月24日的Ruby(红宝石),由日本人松本行弘(Yuki Matsumoto)于1994年12月发布。 Ruby 作为一种纯面向对象的脚本程序设计语言,吸收了Smalltalk和Perl两种程序语言的特性。
Ruby理念[2]
1.首先考虑的是,减少编程时不必要的琐碎时间,令编写程序的人高兴;
2.其次是良好的界面设计;
3.强调系统设计必须人性化,而不是一味从机器的角度设想。
Linux中安装Ruby[3]
依赖于您所使用的Linux发行版本,有一些安装Ruby的方法。首选方法是简单地下载源代码并亲自编译。而在一些操作系统平台中,用安装包管理解决方法,可以极其简单地安装Ruby。
例如,在Debian或Ubuntu中apt-get工具提供了一种简易而优美的解决方案:
% sudo apt-get install ruby1.9.1-full
上述命令安装目前稳定的Ruby版本1.9.1。如果您喜欢安装Ruby1.8版本,您可以使用以下命令安装:
% sudo apt-get install ruby-full
程序示例
#!/usr/bin/env ruby
# hello.ry
puts "Hello, world!"
端中输入以下命令:
$chmod a+x hello.ry
$hello.ry
结果输出显示是:
Hello, world!
资源
Ruby官方网:http://www.ruby-lang.org/en/
Ruby正体中文网:http://www.ruby-lang.org/zh_TW/
Ruby简体中文网:http://www.ruby-lang.org/zh_cn/
Rails中Ruby程序设计指南:
http://www.meshplex.org/wiki/Ruby/Ruby_on_Rails_programming_tutorials
参考文献
1.维基百科http://zh.wikipedia.org/wiki/Ruby
2.Ruby官方网站http://www.ruby-lang.org/en/
相关文档:
原文连接: http://hi.baidu.com/%B7%CF%B2%C5%CB%FB%B8%E7/blog/item/09c19411244152daf7039ec4.html
通过命令行查看ruby版本信息:
ruby -v
命令行运行程序:
方法1.
ruby -e 'print "hello ruby"'
-e 表示将后面的一行作为ruby程序
print 是ruby的一个内置函数
方法2.交互编译环境
irb (命令行输入后, ......
http://www.gayathri-frenzy.com/technology/ruby-on-rails
I kept thinking for a while on what do I have next in the store
Here we go “Ruby on Rails”
Ruby on Rails, often shortened to Rails or RoR, is an open source web application framework for the Ruby Programming language.Ruby is a ......
phpRPC + Ruby + Arduino = 遠程控制LED開關(?)
嗯,我知道這是個很無聊的Sample :P
關於phpRPC與Arduino請自行Google
觀看此demo之前請先安裝另外一篇所提到的serialport
與另外一個Gem
套件:phprpc
在這個ļ ......
When I try the command "gem install thrift" with Ruby 1.9.1, I got a compilation error with something related to a C function "strlcpy()".
Then I searched the web. It seems I am not alone and the community know it.
However I do not want to wait for official update, I want to ......